Changeset 3419

Show
Ignore:
Timestamp:
06/10/07 03:37:38 (19 months ago)
Author:
graphittie
Message:

#361 : 플러그인 패널들의 UI 변경.

  • 센터 플러그인 설정화면과 (추가될) 메타 페이지 플러그인 설정화면을 플러그인 메인화면으로 통합. 탭으로 구현됨.
  • 플러그인 필터링 정보를 저장하는 기능을 포함하는 saveScope 추가.
  • TODO : 사용화면 <-> 설정화면 상호간 링크를 추가할 것.
  • 줄바꿈에 문제가 있던 plugin.css 파일의 포맷화. 소스변경 분량이 적으므로 위에서부터 차근히 비교하면 쉽게 구분가능합니다.
Location:
trunk
Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/blog/owner/plugin/index.php

    r3406 r3419  
    88require ROOT . '/lib/piece/owner/header.php'; 
    99require ROOT . '/lib/piece/owner/contentMenu.php'; 
    10 if (defined('__TEXTCUBE_CENTER__')) { 
    11     $scopeType = 'dashboard'; 
    12     $_POST['scopeType'] = $scopeType; 
    13 } 
    14  
    15 if (empty($_POST['sortType'])) { 
    16     $sortType = getUserSetting("pluginListSortType","ascend"); 
    17     $_POST['sortType'] = $sortType; 
    18 } 
    19 setUserSetting("pluginListSortType",$_POST['sortType']); 
    20  
    21 if (empty($_POST['scopeType'])) { 
    22     $scopeType = getUserSetting("pluginListScopeType", "all"); 
    23     $_POST['scopeType'] = $scopeType; 
    24 } 
    25 if (!defined('__TEXTCUBE_CENTER__')) { 
    26     setUserSetting("pluginListScopeType",$_POST['scopeType']); 
    27 } 
    28  
    29 if (empty($_POST['listedPluginStatus'])) { 
    30     $listType = DBQuery::queryCell("SELECT `value` FROM `{$database['prefix']}UserSettings` WHERE `user` = $owner AND `name` = 'listedPluginStatus'"); 
    31     $_POST['listedPluginStatus'] = ($listType == false) ? array("activated", "deactivated") : explode("|", $listType); 
    32 } else if (is_array($_POST['listedPluginStatus'])) { 
    33     sort($_POST['listedPluginStatus']); 
    34     if ($_POST['listedPluginStatus'] != array("activated") && $_POST['listedPluginStatus'] != array("deactivated") && $_POST['listedPluginStatus'] != array("activated", "deactivated")) { 
    35         $_POST['listedPluginStatus'] = array("activated", "deactivated"); 
    36     } 
    37 } else { 
    38     $_POST['listedPluginStatus'] = array("activated", "deactivated"); 
    39 } 
    40  
    41 if (!DBQuery::queryCell("SELECT `value` FROM `{$database['prefix']}UserSettings` WHERE `user` = $owner AND `name` = 'listedPluginStatus'")) { 
    42     DBQuery::execute("INSERT `{$database['prefix']}UserSettings` (`user`, `name`, `value`) VALUES ($owner, 'listedPluginStatus', '".implode("|", $_POST['listedPluginStatus'])."')"); 
    43 } else { 
    44     DBQuery::execute("UPDATE `{$database['prefix']}UserSettings` SET `value` = '".implode("|", $_POST['listedPluginStatus'])."' WHERE `user` = $owner AND `name` = 'listedPluginStatus'"); 
    45 } 
    46  
     10 
     11// set the selected tab. 
     12if (isset($_GET['visibility'])) { 
     13    $_POST['visibility'] = $_GET['visibility']; 
     14} else if (!isset($_POST['visibility'])) { 
     15    $_POST['visibility'] = 'blog'; 
     16} 
     17 
     18switch ($_POST['visibility']) { 
     19    case 'center': 
     20        define('__TAB_CENTER__', true); 
     21        $memberScopes = 'center'; 
     22        break; 
     23    case 'metapage': 
     24        define('__TAB_METAPAGE__', true); 
     25        $memberScopes = 'metapage'; // 임시. 
     26        break; 
     27    case 'blog': 
     28    default: 
     29        define('__TAB_BLOG__', true); 
     30        $memberScopes = 'global|blog|sidebar|admin|editor|formatter|none'; 
     31        $_POST['visibility'] = 'blog'; 
     32        break; 
     33} 
     34 
     35$tabsClass = array(); 
     36$tabsClass[$_POST['visibility']] = true; 
     37 
     38// get and set align type, scope type and status type. 
     39$selectedSort = getUserSetting('pluginListSortType', 'ascend'); 
     40$selectedScopes = explode('|', getUserSetting("pluginListScopeType_{$_POST['visibility']}", $memberScopes)); 
     41$selectedStatus = explode('|', getUserSetting("pluginListStatusType_{$_POST['visibility']}", 'activated|deactivated')); 
     42 
     43// get all plugin list. 
    4744$plugins = array(); 
    4845$pluginAttrs = array(); 
    4946 
     47$xmls = new XMLStruct(); 
    5048$dir = dir(ROOT . '/plugins/'); 
    51 while ($plugin = $dir->read()) { 
    52     if (!ereg('^[[:alnum:] _-]+$', $plugin)) 
     49while (false !== ($plugin = $dir->read())) { // 이게 php.net에서 권장하는 올바른 디렉토리 읽는 법. 
     50    if (!preg_match('@^[A-Za-z0-9 _-]+$@', $plugin)) 
    5351        continue; 
    5452    if (!is_dir(ROOT . '/plugins/' . $plugin)) 
     
    5654    if (!file_exists(ROOT . "/plugins/$plugin/index.xml")) 
    5755        continue; 
    58     $xmls = new XMLStruct(); 
     56     
    5957    if (!$xmls->open(file_get_contents(ROOT . "/plugins/$plugin/index.xml"))) { 
    6058        continue; 
    6159    } else { 
     60        // filter the plugins as the selected scopes. 
     61        $tempXMLPath = array( 
     62                                'admin' => '/plugin/binding/adminMenu', 
     63                                'blog' => '/plugin/binding/tag', 
     64                                'center' => '/plugin/binding/center', 
     65                                //'metapage', '/plugin/binding/metapage', 
     66                                'global' => '/plugin/binding/listener', 
     67                                'sidebar' => '/plugin/binding/sidebar', 
     68                                'editor' => '/plugin/binding/editor', 
     69                                'formatter' => '/plugin/binding/formatter' 
     70                            ); 
     71         
     72        $acceptedPathCount = 0; 
     73        $tempXMLPathCount = 0; 
     74        foreach ($tempXMLPath as $key => $value) { 
     75            if ($xmls->doesExist($value)) { 
     76                $tempXMLPathCount++; 
     77                if (in_array($key, $selectedScopes)) { 
     78                    $acceptedPathCount++; 
     79                } 
     80            } 
     81        } 
     82         
     83        if ($acceptedPathCount > 0 || ($tempXMLPathCount == 0 && in_array('none', $selectedScopes))) { 
     84            // path. 
     85        } else { 
     86            continue; 
     87        } 
     88         
     89        // load plugin information. 
    6290        $pluginDir = trim($plugin); 
    6391        $pluginAttrs[$pluginDir] = array( 
    64                             "link" => $xmls->getValue('/plugin/link[lang()]'), 
    65                             "title" => $xmls->getValue('/plugin/title[lang()]'), 
    66                             "version" => $xmls->getValue('/plugin/version[lang()]'), 
    67                             "description" => $xmls->getValue('/plugin/description[lang()]'), 
    68                             "authorLink" => $xmls->getAttribute('/plugin/author[lang()]', 'link'), 
    69                             "author" => $xmls->getValue('/plugin/author[lang()]'), 
    70                             "scope" => array(), 
    71                             "config" => $xmls->doesExist('/plugin/binding/config'), 
    72                             "width" => $xmls->getAttribute('/plugin/binding/config/window', 'width'), 
    73                             "height" => $xmls->getAttribute('/plugin/binding/config/window', 'height') 
     92                            'link' => $xmls->getValue('/plugin/link[lang()]'), 
     93                            'title' => $xmls->getValue('/plugin/title[lang()]'), 
     94                            'version' => $xmls->getValue('/plugin/version[lang()]'), 
     95                            'description' => $xmls->getValue('/plugin/description[lang()]'), 
     96                            'authorLink' => $xmls->getAttribute('/plugin/author[lang()]', 'link'), 
     97                            'author' => $xmls->getValue('/plugin/author[lang()]'), 
     98                            'config' => $xmls->doesExist('/plugin/binding/config'), 
     99                            'width' => $xmls->getAttribute('/plugin/binding/config/window', 'width'), 
     100                            'height' => $xmls->getAttribute('/plugin/binding/config/window', 'height') 
    74101                            ); 
    75         if ($xmls->doesExist('/plugin/binding/adminMenu')) 
    76             array_push($pluginAttrs[$pluginDir]['scope'], 'admin'); 
    77         if ($xmls->doesExist('/plugin/binding/tag')) 
    78             array_push($pluginAttrs[$pluginDir]['scope'], 'blog'); 
    79         if ($xmls->doesExist('/plugin/binding/center')) 
    80             array_push($pluginAttrs[$pluginDir]['scope'], 'dashboard'); 
    81         if ($xmls->doesExist('/plugin/binding/listener')) 
    82             array_push($pluginAttrs[$pluginDir]['scope'], 'global'); 
    83         if ($xmls->doesExist('/plugin/binding/sidebar')) 
    84             array_push($pluginAttrs[$pluginDir]['scope'], 'sidebar'); 
    85         if ($xmls->doesExist('/plugin/binding/editor')) 
    86             array_push($pluginAttrs[$pluginDir]['scope'], 'editor'); 
    87         if ($xmls->doesExist('/plugin/binding/formatter')) 
    88             array_push($pluginAttrs[$pluginDir]['scope'], 'formatter'); 
    89102 
    90103        $plugins[$pluginDir] = $pluginAttrs[$pluginDir]['title']; 
    91104    } 
    92105} 
    93  
    94 if ($_POST['sortType'] == "ascend") { 
     106unset($xmls); 
     107 
     108// sort as value of $selectedSort. 
     109if ($selectedSort == 'ascend') { 
    95110    asort($plugins); 
    96111} else { 
     
    98113} 
    99114 
    100 $arrayKeys = array_keys($plugins); 
     115$pluginKeys = array_keys($plugins); 
    101116?> 
    102117                        <script type="text/javascript"> 
     
    105120                                 
    106121<?php 
    107 for ($i=0; $i<count($arrayKeys); $i++) { 
    108     $pluginDir = $arrayKeys[$i]; 
     122for ($i=0; $i<count($pluginKeys); $i++) { 
     123    $pluginDir = $pluginKeys[$i]; 
    109124     
    110125    $width = $pluginAttrs[$pluginDir]['width']?$pluginAttrs[$pluginDir]['width']:500; 
     
    208223                                } 
    209224                                 
    210 <?php 
    211 if (defined('__TEXTCUBE_CENTER__')) { 
    212 ?> 
    213                                 function changeList() { 
    214                                     document.getElementById("part-center-plugins").submit(); 
     225                                function changeList(obj) { 
     226                                    var currentTab = getObject('currentTab'); 
     227                                     
     228                                    var scope = new Array(); 
     229                                    var status = new Array(); 
     230                                     
     231                                    var scopeCount = 0; 
     232                                    var statusCount = 0; 
     233                                     
     234                                    for (var i=0; getObject('part-plugin-list').elements[i]; i++) { 
     235                                        oElement = getObject('part-plugin-list').elements[i]; 
     236                                        if (oElement.name == 'scopeType' && oElement.checked == true) { 
     237                                            scope[scopeCount] = oElement.value; 
     238                                            scopeCount++; 
     239                                        } else if (oElement.name == 'pluginStatus' && oElement.checked == true) { 
     240                                            status[statusCount] = oElement.value; 
     241                                            statusCount++; 
     242                                        } else if (oElement.name == 'sortType' && oElement.checked == true) { 
     243                                            var sort = oElement.value; 
     244                                        } 
     245                                    } 
     246                                     
     247                                    if (scope.length == 0 || status.length == 0) { 
     248                                        obj.checked = true; 
     249                                        return false; 
     250                                    } 
     251                                     
     252                                    var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/plugin/saveScope"); 
     253                                    request.onSuccess = function() { 
     254                                        window.location.reload(true); 
     255                                    } 
     256                                     
     257                                    request.onError = function() { 
     258                                        alert("<?php echo _t('선택하신 조건을 적용하지 못했습니다.');?>"); 
     259                                    } 
     260                                     
     261                                    request.send("visibility=" + currentTab.value + "&scope=" + scope.join('|') + "&status=" + status.join('|') + "&sort=" + sort); 
    215262                                } 
    216 <?php 
    217 } else { 
    218 ?> 
    219                                 function changeList() { 
    220                                     document.getElementById("part-plugin-list").submit(); 
    221                                 } 
    222 <?php 
    223 } 
    224 ?> 
    225263                                 
    226264                                window.addEventListener("load", execLoadFunction, false); 
    227265                                 
    228266                                function execLoadFunction() { 
    229                                     removeItselfById('submit-button-box'); 
    230                                      
    231                                     for (var i = 0; document.getElementById('part-plugin-list').elements[i]; i++) { 
    232                                         oElement = document.getElementById('part-plugin-list').elements[i]; 
    233                                         if ((oElement.name == 'entry')) 
    234                                             oElement.style.display= 'none'; 
     267                                    for (var i=0; getObject('part-plugin-list').elements[i]; i++) { 
     268                                        oElement = getObject('part-plugin-list').elements[i]; 
     269                                        if ((oElement.name == 'plugin')) 
     270                                            oElement.style.display = 'none'; 
    235271                                    } 
    236272                                } 
     
    246282                        </script> 
    247283                         
    248                         <form id="<?php 
    249 if (defined('__TEXTCUBE_CENTER__')) 
    250     echo 'part-center-plugins'; 
    251 else 
    252     echo 'part-plugin-list'; 
    253                         ?>" class="part" method="post" action="<?php 
    254 if (defined('__TEXTCUBE_CENTER__')) 
    255     echo $blogURL."/owner/center/setting"; 
    256 else 
    257     echo $blogURL."/owner/plugin"; 
    258 ?>"> 
    259                             <h2 class="caption"><span class="main-text"><?php 
    260 if (defined('__TEXTCUBE_CENTER__')) 
    261     echo _t('설치된 자투리 플러그인입니다'); 
    262 else  
    263     echo _t('설치된 플러그인입니다'); 
    264 ?></span></h2> 
     284                        <form id="part-plugin-list" class="part" method="post" action="<?php echo $blogURL."/owner/plugin";?>"> 
     285                            <h2 class="caption"><span class="main-text"><?php echo _t('설치된 플러그인 목록입니다');?></span></h2> 
    265286                             
    266287                            <div class="main-explain-box"> 
    267                                 <p class="explain"><?php 
    268 if (defined('__TEXTCUBE_CENTER__')) 
    269     echo _t('자투리는 조각보에 기능을 추가합니다. 이 곳에서 자투리들의 사용 여부를 결정할 수 있습니다.'); 
    270 else 
    271     echo _t('플러그인은 텍스트큐브의 기능을 확장합니다. 이 곳에서 설치된 플러그인의 사용 여부를 결정할 수 있습니다.'); 
    272 ?></p> 
     288                                <p class="explain"><?php echo _t('플러그인은 텍스트큐브의 기능을 확장합니다. 이 곳에서 설치된 플러그인의 사용 여부를 결정할 수 있습니다.');?></p> 
    273289                            </div> 
    274290                             
     291                            <ul id="plugin-tabs-box" class="tabs-box"> 
     292                                <li<?php echo isset($tabsClass['blog']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/plugin"><?php echo _t('블로그/관리자 플러그인');?></a></li> 
     293                                <li<?php echo isset($tabsClass['center']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/plugin?visibility=center"><?php echo _t('센터 플러그인');?></a></li> 
     294                                <li<?php echo isset($tabsClass['metapage']) ? ' class="selected"' : NULL;?>><a href="<?php echo $blogURL;?>/owner/plugin?visibility=metapage"><?php echo _t('메타 페이지 플러그인');?></a></li> 
     295                            </ul> 
     296                             
    275297                            <fieldset id="plugin-display-box"> 
    276                                 <legend><?php echo _t('표시될 플러그인 설정');?></legend> 
    277  
    278                                 <dl id="sorting-line" class="line"> 
    279                                     <dt><?php echo _t('정렬');?></dt> 
    280                                     <dd> 
    281                                         <input type="radio" class="radio" id="ascend-sorting" name="sortType" value="ascend" onclick="changeList()"<?php echo $_POST['sortType'] == "ascend" ? ' checked="checked"' : '';?> /><label for="ascend-sorting"><?php echo _t('오름차순');?></label> 
    282                                         <input type="radio" class="radio" id="descend-sorting" name="sortType" value="descend" onclick="changeList()"<?php echo $_POST['sortType'] == "descend" ? ' checked="checked"' : '';?> /><label for="descend-sorting"><?php echo _t('내림차순');?></label> 
    283                                     </dd> 
    284                                 </dl> 
    285                                  
    286                                 <dl id="activate-status-line" class="line"> 
    287                                     <dt><?php echo _t('상태');?></dt> 
    288                                     <dd> 
    289                                         <input type="checkbox" class="checkbox" id="activated-plugin" name="listedPluginStatus[]" value="activated" onclick="changeList()"<?php echo in_array("activated", $_POST['listedPluginStatus']) ? ' checked="checked"' : '';?> /><label for="activated-plugin"><?php echo _t('사용중인 플러그인 / 모듈');?></label> 
    290                                         <input type="checkbox" class="checkbox" id="deactivated-plugin" name="listedPluginStatus[]" value="deactivated" onclick="changeList()"<?php echo in_array("deactivated", $_POST['listedPluginStatus']) ? ' checked="checked"' : '';?> /><label for="deactivated-plugin"><?php echo _t('사용하지 않는 플러그인 / 모듈');?></label> 
    291                                     </dd> 
    292                                 </dl> 
    293                                  
    294 <?php 
    295 if (!defined('__TEXTCUBE_CENTER__')) { 
    296 ?> 
     298                                <legend><?php echo _t('표시할 플러그인의 종류를 선택하세요.');?></legend> 
     299                                 
    297300                                <dl id="scope-line" class="line"> 
    298                                     <dt><?php echo _t('일반');?></dt> 
    299                                     <dd id="scope-line-general"> 
    300                                         <ul> 
    301                                             <li><input type="radio" class="radio" id="global-scope" name="scopeType" value="all" onclick="changeList()"<?php echo $_POST['scopeType'] == "all" ? ' checked="checked"' : '';?> /><label id="global-scope-label" for="global-scope"<?php echo $_POST['scopeType'] == "all" ? ' class="selected"' : '';?>><?php echo _t('전체');?></label></li> 
    302                                             <li><input type="radio" class="radio" id="none-scope" name="scopeType" value="none" onclick="changeList()"<?php echo $_POST['scopeType'] == "none" ? ' checked="checked"' : '';?> /><label id="none-scope-label" for="none-scope"<?php echo $_POST['scopeType'] == "none" ? ' class="selected"' : '';?>><?php echo _t('분류 없음');?></label></li> 
    303                                         </ul> 
    304                                     </dd> 
    305                                     <dt><?php echo _t('플러그인');?></dt> 
     301                                    <dt><?php echo _t('기능');?></dt> 
    306302                                    <dd id="scope-line-plugin"> 
    307303                                        <ul> 
    308                                             <li><input type="radio" class="radio" id="common-scope" name="scopeType" value="global" onclick="changeList()"<?php echo $_POST['scopeType'] == "global" ? ' checked="checked"' : '';?> /><label id="common-scope-label" for="common-scope"<?php echo $_POST['scopeType'] == "global" ? ' class="selected"' : '';?>><?php echo _t('일반');?></label></li> 
    309                                             <li><input type="radio" class="radio" id="blog-scope" name="scopeType" value="blog" onclick="changeList()"<?php echo $_POST['scopeType'] == "blog" ? ' checked="checked"' : '';?> /><label id="blog-scope-label" for="blog-scope"<?php echo $_POST['scopeType'] == "blog" ? ' class="selected"' : '';?>><?php echo _t('블로그 출력');?></label></li> 
    310                                             <li><input type="radio" class="radio" id="sidebar-scope" name="scopeType" value="sidebar" onclick="changeList()"<?php echo $_POST['scopeType'] == "sidebar" ? ' checked="checked"' : '';?> /><label id="sidebar-scope-label" for="sidebar-scope"<?php echo $_POST['scopeType'] == "sidebar" ? ' class="selected"' : '';?>><?php echo _t('사이드바');?></label></li> 
    311                                             <li><input type="radio" class="radio" id="admin-scope" name="scopeType" value="admin" onclick="changeList()"<?php echo $_POST['scopeType'] == "admin" ? ' checked="checked"' : '';?> /><label id="admin-scope-label" for="admin-scope"<?php echo $_POST['scopeType'] == "admin" ? ' class="selected"' : '';?>><?php echo _t('관리 패널');?></label></li> 
    312                                         </ul> 
    313                                     </dd> 
    314                                     <dt><?php echo _t('모듈');?></dt> 
    315                                     <dd id="scope-line-module"> 
    316                                         <ul> 
    317                                             <li><input type="radio" class="radio" id="editor-scope" name="scopeType" value="editor" onclick="changeList()"<?php echo $_POST['scopeType'] == "editor" ? ' checked="checked"' : '';?> /><label id="editor-scope-label" for="editor-scope"<?php echo $_POST['scopeType'] == "editor" ? ' class="selected"' : '';?>><?php echo _t('에디터');?></label></li> 
    318                                             <li><input type="radio" class="radio" id="formatter-scope" name="scopeType" value="formatter" onclick="changeList()"<?php echo $_POST['scopeType'] == "formatter" ? ' checked="checked"' : '';?> /><label id="formatter-scope-label" for="formatter-scope"<?php echo $_POST['scopeType'] == "formatter" ? ' class="selected"' : '';?>><?php echo _t('포매터');?></label></li> 
     304<?php 
     305if (defined('__TAB_BLOG__')) { 
     306?> 
     307                                            <li><input type="checkbox" class="checkbox" id="blog-scope" name="scopeType" value="blog" onclick="changeList(this)"<?php echo in_array('blog', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="blog-scope-label" for="blog-scope"<?php echo in_array('blog', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('블로그 플러그인');?></label></li> 
     308                                            <li><input type="checkbox" class="checkbox" id="sidebar-scope" name="scopeType" value="sidebar" onclick="changeList(this)"<?php echo in_array('sidebar', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="sidebar-scope-label" for="sidebar-scope"<?php echo in_array('sidebar', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('사이드바 플러그인');?></label></li> 
     309                                            <li><input type="checkbox" class="checkbox" id="admin-scope" name="scopeType" value="admin" onclick="changeList(this)"<?php echo in_array('admin', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="admin-scope-label" for="admin-scope"<?php echo in_array('admin', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('관리자 플러그인');?></label></li> 
     310                                            <li><input type="checkbox" class="checkbox" id="common-scope" name="scopeType" value="global" onclick="changeList(this)"<?php echo in_array('global', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="common-scope-label" for="common-scope"<?php echo in_array('global', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('기타 플러그인');?></label></li> 
     311                                            <li><input type="checkbox" class="checkbox" id="none-scope" name="scopeType" value="none" onclick="changeList(this)"<?php echo in_array('none', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="none-scope-label" for="none-scope"<?php echo in_array('none', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('분류 없음');?></label></li> 
    319312                                        </ul> 
    320313                                    </dd> 
    321314                                </dl> 
    322 <?php 
    323 } else { 
    324     if (($_SERVER['REQUEST_METHOD'] == 'POST') && (empty($_POST['useTTdashboard']))) { 
    325         $textcubeDashboard = getUserSetting("textcubeDashboard"); 
    326         if (is_null($textcubeDashboard)) { 
    327             setUserSetting("textcubeDashboard", 1); 
    328             $textcubeDashboard = 1; 
    329         } else { 
    330             setUserSetting("textcubeDashboard", 0); 
    331             $textcubeDashboard = 0; 
    332         } 
    333     } else { 
    334         setUserSetting("textcubeDashboard", 1); 
    335         $textcubeDashboard = 1; 
    336     } 
    337 ?> 
    338                                 <dl id="independent-notice-line" class="line"> 
    339                                     <dt><?php echo _t('독립패널 설정');?></dt> 
     315                                <dl id="module-line" class="line"> 
     316                                    <dt><?php echo _t('모듈');?></dt> 
    340317                                    <dd> 
    341                                         <input type="checkbox" class="checkbox" id="useTTdashboard" name="useTTdashboard" value="on" onclick="changeList()"<?php echo $textcubeDashboard == 1 ? " checked" : NULL;?> /> 
    342                                         <label for="useTTdashboard"><?php echo _t('조각보에 텍스트큐브 독립 패널을 표시합니다.');?></label> 
     318                                        <ul> 
     319                                            <li><input type="checkbox" class="checkbox" id="editor-scope" name="scopeType" value="editor" onclick="changeList(this)"<?php echo in_array('editor', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="editor-scope-label" for="editor-scope"<?php echo in_array('editor', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('에디터 모듈');?></label></li> 
     320                                            <li><input type="checkbox" class="checkbox" id="formatter-scope" name="scopeType" value="formatter" onclick="changeList(this)"<?php echo in_array('formatter', $selectedScopes) ? ' checked="checked"' : '';?> /><label id="formatter-scope-label" for="formatter-scope"<?php echo in_array('formatter', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('포매터 모듈');?></label></li> 
     321<?php 
     322} else if (defined('__TAB_CENTER__')) { 
     323?> 
     324                                            <li><input type="checkbox" class="checkbox" id="center-scope" name="scopeType" value="center" onclick="this.checked=true;" checked="checked" /><label id="center-scope-label" for="center-scope"<?php echo in_array('center', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('센터 플러그인');?></label></li> 
     325<?php 
     326} else if (defined('__TAB_METAPAGE__')) { 
     327?> 
     328                                            <li><input type="checkbox" class="checkbox" id="metapage-scope" name="scopeType" value="metapage" onclick="this.checked=true;" checked="checked" /><label id="metapage-scope-label" for="metapage-scope"<?php echo in_array('metapage', $selectedScopes) ? ' class="selected"' : '';?>><?php echo _t('메타 페이지 플러그인');?></label></li> 
     329<?php 
     330} 
     331?> 
     332                                        </ul> 
    343333                                    </dd> 
    344334                                </dl> 
    345 <?php 
    346 } 
    347 ?> 
    348                                  
    349                                 <div id="submit-button-box" class="button-box"> 
    350                                     <input type="submit" value="<?php echo _t('플러그인 목록 갱신');?>" /> 
    351                                 </div> 
     335                                 
     336                                <dl id="status-line" class="line"> 
     337                                    <dt><?php echo _t('상태');?></dt> 
     338                                    <dd id="sorting-line-status"> 
     339                                        <label for="activated-plugin"><input type="checkbox" class="checkbox" id="activated-plugin" name="pluginStatus" value="activated" onclick="changeList(this)"<?php echo in_array('activated', $selectedStatus) ? ' checked="checked"' : '';?> /><?php echo defined('__TAB_ETC__') ? _t('사용중인 플러그인/모듈') : _t('사용중인 플러그인');?></label> 
     340                                        <label for="deactivated-plugin"><input type="checkbox" class="checkbox" id="deactivated-plugin" name="pluginStatus" value="deactivated" onclick="changeList(this)"<?php echo in_array('deactivated', $selectedStatus) ? ' checked="checked"' : '';?> /><?php echo defined('__TAB_ETC__') ? _t('사용중이 아닌 플러그인/모듈') : _t('사용하지 않는 플러그인');?></label> 
     341                                    </dd> 
     342                                </dl> 
     343                                 
     344                                <dl id="sorting-line" class="line"> 
     345                                    <dt class="hidden"><?php echo _t('정렬');?></dt> 
     346                                    <dd id="sorting-line-align"> 
     347                                        <input type="radio" class="radio" id="ascend-sorting" name="sortType" value="ascend" onclick="changeList(this)"<?php echo $selectedSort == 'ascend' ? ' checked="checked"' : '';?> /><label for="ascend-sorting"><?php echo _t('오름차순');?></label> 
     348                                        <input type="radio" class="radio" id="descend-sorting" name="sortType" value="descend" onclick="changeList(this)"<?php echo $selectedSort == 'descend' ? ' checked="checked"' : '';?> /><label for="descend-sorting"><?php echo _t('내림차순');?></label> 
     349                                    </dd> 
     350                                </dl> 
    352351                            </fieldset> 
    353352                             
     
    355354                                <ul class="data-inbox"> 
    356355<?php 
    357 for ($i=0; $i<count($arrayKeys); $i++) { 
    358     $pluginDir = $arrayKeys[$i]; 
     356for ($i=0; $i<count($pluginKeys); $i++) { 
     357    $pluginDir = $pluginKeys[$i]; 
    359358     
    360359    $link = $pluginAttrs[$pluginDir]['link']; 
     
    364363    $authorLink = $pluginAttrs[$pluginDir]['authorLink']; 
    365364    $author = $pluginAttrs[$pluginDir]['author']; 
    366     $scope = $pluginAttrs[$pluginDir]['scope']; 
    367     $config = $pluginAttrs[$pluginDir]['config']? 'Y':'N'; 
    368     $width = $pluginAttrs[$pluginDir]['width']?$pluginAttrs[$pluginDir]['width']:500; 
    369     $height = $pluginAttrs[$pluginDir]['height']?$pluginAttrs[$pluginDir]['height']:400; 
     365    $config = $pluginAttrs[$pluginDir]['config'] ? 'Y':'N'; 
     366    $width = $pluginAttrs[$pluginDir]['width'] ? $pluginAttrs[$pluginDir]['width'] : 500; 
     367    $height = $pluginAttrs[$pluginDir]['height'] ? $pluginAttrs[$pluginDir]['height'] : 400; 
    370368    $active = in_array($pluginDir, $activePlugins); 
    371369     
    372     if (count($scope) == 0) 
    373         $scope = array('none'); 
    374          
    375     if ($_POST['scopeType'] != 'all') 
    376         if (!in_array($_POST['scopeType'], $scope)) 
    377             continue; 
    378     if (!defined('__TEXTCUBE_CENTER__')) { 
    379         if (in_array('dashboard', $scope) && (count($scope) == 1)) { 
    380             continue; 
    381         } 
    382     } 
    383      
    384     if ($active == true && !in_array("activated", $_POST['listedPluginStatus'])) 
    385         continue; 
    386     else if ($active == false && !in_array("deactivated", $_POST['listedPluginStatus'])) 
     370    if ($active == true && !in_array('activated', $selectedStatus)) 
     371        continue; 
     372    else if ($active == false && !in_array('deactivated', $selectedStatus)) 
    387373        continue; 
    388374     
    389375    $className = $active ? 'active-class' : 'inactive-class'; 
    390     $className .= $i == (count($arrayKeys) - 1) ? ' last-item' : NULL; 
     376    $className .= $i == (count($pluginKeys) - 1) ? ' last-item' : NULL; 
    391377?> 
    392378                                    <li class="<?php echo $className;?>"> 
     
    438424    if ($active) { 
    439425?> 
    440                                                 <input type="checkbox" class="input-checkbox" name="entry" value="<?php echo $pluginDir;?>" title="<?php echo _t('이 플러그인은 사용중입니다. 클릭하시면 사용을 중지합니다.');?>" checked="checked" /> 
     426                                                <input type="checkbox" class="input-checkbox" name="plugin" value="<?php echo $pluginDir;?>" title="<?php echo _t('이 플러그인은 사용중입니다. 클릭하시면 사용을 중지합니다.');?>" checked="checked" /> 
    441427<?php 
    442428    } else { 
    443429?> 
    444                                                 <input type="checkbox" class="input-checkbox" name="entry" value="<?php echo $pluginDir;?>" title="<?php echo _t('이 플러그인은 사용중지 상태입니다. 클릭하시면 사용을 시작합니다.');?>" /> 
     430                                                <input type="checkbox" class="input-checkbox" name="plugin" value="<?php echo $pluginDir;?>" title="<?php echo _t('이 플러그인은 사용중지 상태입니다. 클릭하시면 사용을 시작합니다.');?>" /> 
    445431<?php 
    446432    } 
     
    477463                                <div class="clear"></div> 
    478464                            </div> 
     465                             
     466                            <input type="hidden" id="currentTab" name="currentTab" value="<?php echo $_POST['visibility'];?>" /> 
    479467                        </form> 
    480468                         
  • trunk/style/admin/default/plugin.css

    r3404 r3419