From: shizuki Date: Mon, 4 Dec 2006 14:52:40 +0000 (+0000) Subject: ちょっとだけ整形 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f15c6377d120d020d2d2f15df7a935aee104b4c0;p=nucleus-jp%2Fnucleus-plugins.git ちょっとだけ整形 git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@515 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- diff --git a/trunk/NP_Dtree/NP_Dtree.php b/trunk/NP_Dtree/NP_Dtree.php index 7eeb5f4..8edeb45 100644 --- a/trunk/NP_Dtree/NP_Dtree.php +++ b/trunk/NP_Dtree/NP_Dtree.php @@ -1,121 +1,136 @@ createOption('folderLinks', _DTREE_DIR_LINK, 'yesno', 'yes'); - $this->createOption('useSelection', _DTREE_SELECTION, 'yesno', 'no'); - $this->createOption('useCookies', _DTREE_COOKIE, 'yesno', 'no'); - $this->createOption('useLines', _DTREE_LINE, 'yesno', 'yes'); - $this->createOption('useIcons', _DTREE_ICON, 'yesno', 'yes'); - $this->createOption('useStatusText', _DTREE_ST_TEXT, 'yesno', 'no'); - $this->createOption('closeSameLevel', _DTREE_CL_SLEVEL, 'yesno', 'no'); - $this->createOption('inOrder', _DTREE_IN_ORDER, 'yesno', 'no'); - } - - function init() - { - global $admin; - $language = ereg_replace( '[\\|/]', '', getLanguageName()); - if (file_exists($this->getDirectory().'language/'.$language.'.php')) { - include_once($this->getDirectory().'language/'.$language.'.php'); - }else { - include_once($this->getDirectory().'language/english.php'); - } - } - - function doSkinVar($skinType, $itemid=0) - { - global $blogid, $catid, $subcatid; - if (is_numeric($blogid)) { - $blogid = intval($blogid); - } else { - $id = getBlogIDFromName($blogid); - $blogid = intval($id); - } - $itemid = intval($itemid); - $catid = intval($catid); - $subcatid = intval($subcatid); - - $randomID = 'tree' . uniqid(rand()); - - echo ''; - - if ($skinType == 'template') { - echo ''; - echo 'open all' . - ' | close all'; - return; - } - - $eq = ''; - if (!empty($catid)) { - } $eq .= '&cid=' . $catid; - if (!empty($subcatid)) { - $eq .= '&sid=' . $subcatid; - } - - echo ''; - echo '' . _DTREE_OPENALL . '' . - ' | ' . _DTREE_CLOSEALL . ''; - - } - - function doTemplateVar(&$item) - { - $this->doSkinVar('template', $item->itemid); - } + function getName() + { + return 'Navigation Tree'; + } + + function getAuthor() + { + return 'nakahara21 + shizuki'; + } + + function getURL() + { + return 'http://nakahara21.com/'; + } + + function getVersion() + { + return '0.94'; + } + + function getDescription() + { + return _DTREE_DESCRIPTION; //'Show Navigation Tree. Usage: <%Dtree()%>'; + } + + function supportsFeature($what) + { + switch($what){ + case 'SqlTablePrefix': + return 1; + default: + return 0; + } + } + + function install() + { + $this->createOption('folderLinks', _DTREE_DIR_LINK, 'yesno', 'yes'); + $this->createOption('useSelection', _DTREE_SELECTION, 'yesno', 'no'); + $this->createOption('useCookies', _DTREE_COOKIE, 'yesno', 'no'); + $this->createOption('useLines', _DTREE_LINE, 'yesno', 'yes'); + $this->createOption('useIcons', _DTREE_ICON, 'yesno', 'yes'); + $this->createOption('useStatusText', _DTREE_ST_TEXT, 'yesno', 'no'); + $this->createOption('closeSameLevel', _DTREE_CL_SLEVEL, 'yesno', 'no'); + $this->createOption('inOrder', _DTREE_IN_ORDER, 'yesno', 'no'); + } + + function init() + { + global $admin; + $language = ereg_replace( '[\\|/]', '', getLanguageName()); + if (file_exists($this->getDirectory().'language/'.$language.'.php')) { + include_once($this->getDirectory().'language/'.$language.'.php'); + }else { + include_once($this->getDirectory().'language/english.php'); + } + } + + function doSkinVar($skinType, $itemid = 0) + { + global $blogid, $catid, $subcatid; + $adminURL = htmlspecialchars($this->getAdminURL(), ENT_QUOTES, _CHARSET); + if (is_numeric($blogid)) { + $blogid = intval($blogid); + } else { + $id = getBlogIDFromName($blogid); + $blogid = intval($id); + } + $itemid = intval($itemid); + $catid = intval($catid); + $subcatid = intval($subcatid); + +// $randomID = 'tree' . uniqid(rand()); + $randomID = 'tree' . preg_replace('|[^0-9a-f]|i', '', uniqid(rand())); + + echo '' . "\n"; + + if ($skinType == 'template') { + $data = '' . "\n"; + echo $data; + $data = '' . _DTREE_OPENALL . '' . "\n" + . ' | ' . "\n" + . '' . _DTREE_CLOSEALL . '' . "\n"; + echo $data; + return; + } + + $eq = ''; + if (!empty($catid)) { + } $eq .= '&cid=' . $catid; + if (!empty($subcatid)) { + $eq .= '&sid=' . $subcatid; + } + + $data = ''; + echo $data; + $data = '' . _DTREE_OPENALL . '' . "\n" + . ' | ' . "\n" + . '' . _DTREE_CLOSEALL . '' . "\n"; + echo $data; + + } + + function doTemplateVar(&$item) + { + $this->doSkinVar('template', $item->itemid); + } } -?> \ No newline at end of file +?>