OSDN Git Service

ADD/FIX/CHANGE/REMOVE: スキン・テンプレート表示処理の改良
[nucleus-jp/nucleus-next.git] / nucleus / libs / showlist.php
index 5a09e7e..efe6aab 100644 (file)
 \r
 \r
 // can take either an array of objects, or an SQL query\r
-function showlist($query, $type, $vars, $templateName = '')\r
+function showlist($query, $type, $vars, $template_name = '')\r
 {\r
-       if ( is_array($query) )\r
+       $contents = '';\r
+       \r
+       /* count */\r
+       if ( is_string($query) )\r
        {\r
-               if ( sizeof($query) == 0 )\r
-               {\r
-                       return 0;\r
-               }\r
-               \r
-               call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName);\r
-               \r
-               foreach ( $query as $currentObj )\r
-               {\r
-                       $vars['current'] = $currentObj;\r
-                       call_user_func("listplug_{$type}", $vars, 'BODY', $templateName);\r
-               }\r
-               \r
-               call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName);\r
-               \r
-               return sizeof($query);\r
+               $resource = DB::getResult($query);\r
        }\r
        else\r
        {\r
-               $res = DB::getResult($query);\r
-               \r
-               // don't do anything if there are no results\r
-               $numrows = $res->rowCount();\r
-               if ( $numrows == 0 )\r
-               {\r
-                       return 0;\r
-               }\r
-               call_user_func("listplug_{$type}", $vars, 'HEAD', $templateName);\r
-               \r
-               while( $vars['current'] = $res->fetchObject() )\r
-               {\r
-                       call_user_func("listplug_{$type}", $vars, 'BODY', $templateName);\r
-               }\r
-               \r
-               call_user_func("listplug_{$type}", $vars, 'FOOT', $templateName);\r
-               \r
-               $res->closeCursor();\r
-               \r
-               // return amount of results\r
-               return $numrows;\r
+               $resource = $query;\r
+       }\r
+       \r
+       /* HEAD */\r
+       $contents .= call_user_func("listplug_{$type}", $vars, 'HEAD', $template_name);\r
+       \r
+       /* BODY */\r
+       foreach ( $resource as $row )\r
+       {\r
+               $vars['current'] = $row;\r
+               $contents .= call_user_func("listplug_{$type}", $vars, 'BODY', $template_name);\r
+       }\r
+       \r
+       /* FOOT */\r
+       $contents .= call_user_func("listplug_{$type}", $vars, 'FOOT', $template_name);\r
+       \r
+       /* close SQL resource */\r
+       if ( is_string($query) )\r
+       {\r
+               $resource->closeCursor();\r
        }\r
+       \r
+       return $contents;\r
 }\r
 \r
-function listplug_select($vars, $type, $templateName = '')\r
+function listplug_select($vars, $type, $template_name = '')\r
 {\r
-       global $DIR_LIBS, $manager;\r
+       global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -81,7 +70,7 @@ function listplug_select($vars, $type, $templateName = '')
                case 'HEAD':\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_HEAD']) )\r
                        {\r
-                               $template = "<select<%name%><%tabindex%><%javascript%>>\n"\r
+                               $template = "<select name=\"<%name%>\" tabindex=\"<%tabindex%>\" <%javascript%>>\n"\r
                                          . "<%extraoption%>\n";\r
                        }\r
                        else\r
@@ -89,36 +78,36 @@ function listplug_select($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_SELECT_HEAD'];\r
                        }\r
                        $data = array(\r
-                               'name'                  => isset($vars['name'])                 ? ' name="' . $vars['name'] . '"'                       : '',\r
-                               'tabindex'              => isset($vars['tabindex'])             ? ' tabindex="' . $vars['tabindex'] . '"'       : '',\r
-                               'javascript'    => isset($vars['javascript'])   ? ' ' . $vars['javascript']                                     : '',\r
-                               'extraoption'   => isset($vars['extra'])                ? '<option value="' . $vars['extra'] . '">' . $vars['extra'] . "</option>" : ''\r
+                               'name'                  => $vars['name'],\r
+                               'tabindex'              => $vars['tabindex'],\r
+                               'javascript'    => !array_key_exists('javascript', $vars) ? '' : $vars['javascript'],\r
+                               'extraoption'   => !array_key_exists('extra', $vars) ? '' : "<option value=\"\">{$vars['extra']}</option>"\r
                        );\r
                        break;\r
                case 'BODY':\r
                        $current = $vars['current'];\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_BODY']) )\r
                        {\r
-                               $template = "<option value=\"<%value%>\"<%selected%><%title%>><%option%></option>\n";\r
+                               $template = "<option value=\"<%value%>\" <%selected%> title=\"<%title%>\"><%option%></option>\n";\r
                        }\r
                        else\r
                        {\r
                                $template = $templates['SHOWLIST_LISTPLUG_SELECT_BODY'];\r
                        }\r
                        $data = array(\r
-                               'value'         => Entity::hsc($current->value),\r
-                               'selected'      => ($vars['selected'] == $current->value) ? ' selected="selected"' : '',\r
+                               'value'         => Entity::hsc($current['value']),\r
+                               'selected'      => ($vars['selected'] == $current['value']) ? 'selected="selected"' : '',\r
                        );\r
                        if ( array_key_exists('shorten', $vars) && $vars['shorten'] > 0 )\r
                        {\r
-                               $data['title'] = ' title="' . Entity::hsc($current->text) . '"';\r
-                               $current->text = Entity::hsc(Entity::shorten($current->text, $vars['shorten'], $vars['shortenel']));\r
+                               $data['title'] = Entity::hsc($current['text']);\r
+                               $data['option'] = Entity::hsc(Entity::shorten($current['text'], $vars['shorten'], $vars['shortenel']));\r
                        }\r
                        else\r
                        {\r
                                $data['title'] = '';\r
                        }\r
-                       $data['option'] = Entity::hsc($current->text);\r
+                       $data['option'] = Entity::hsc($current['text']);\r
                        break;\r
                case 'FOOT':\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_SELECT_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_SELECT_FOOT']) )\r
@@ -133,27 +122,17 @@ function listplug_select($vars, $type, $templateName = '')
                        break;\r
        }\r
        \r
-       if ( !class_exists('Actions') )\r
-       {\r
-               include "{$DIR_LIBS}ACTIONS.php";\r
-       }\r
-       $template = Template::fill($template, $data);\r
-       $handler = new Actions('template');\r
-       \r
-       $parser = new Parser($handler);\r
-       $parser->parse($template);\r
-       \r
-       return;\r
+       return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table($vars, $type, $templateName = '')\r
+function listplug_table($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -161,7 +140,7 @@ function listplug_table($vars, $type, $templateName = '')
                case 'HEAD':\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_HEAD']) )\r
                        {\r
-                               $template = "<table frame=\"box\" rules=\"all\" summary=\"{$templateName}\">\n"\r
+                               $template = "<table frame=\"box\" rules=\"all\" summary=\"{$template_name}\">\n"\r
                                          . "<thead>\n"\r
                                          . "<tr>\n"\r
                                          . "<%typehead%>\n"\r
@@ -174,7 +153,7 @@ function listplug_table($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_HEAD'];\r
                        }\r
                        $data = array(\r
-                               'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $templateName)\r
+                               'typehead' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'HEAD', $template_name)\r
                        );\r
                        break;\r
                case 'BODY':\r
@@ -190,7 +169,7 @@ function listplug_table($vars, $type, $templateName = '')
                        }\r
                        // tabletype specific thingies\r
                        $data = array(\r
-                               'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $templateName)\r
+                               'typebody' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'BODY', $template_name)\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -206,35 +185,22 @@ function listplug_table($vars, $type, $templateName = '')
                        }\r
                        // tabletype specific thingies\r
                        $data = array(\r
-                               'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $templateName)\r
+                               'typefoot' => call_user_func("listplug_table_" . $vars['content'] , $vars, 'FOOT', $template_name)\r
                        );\r
                        break;\r
        }\r
        \r
-       $template = Template::fill($template, $data);\r
-       \r
-       if ( !class_exists('Actions') )\r
-       {\r
-               global $DIR_LIBS;\r
-               include $DIR_LIBS . 'ACTIONS.php';\r
-       }\r
-       \r
-       $handler = new Actions('template', $template, $data);\r
-       \r
-       $parser = new PARSER($handler);\r
-       $parser->parse($template);\r
-       \r
-       return;\r
+       return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_memberlist($vars, $type, $templateName = '')\r
+function listplug_table_memberlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -284,14 +250,14 @@ function listplug_table_memberlist($vars, $type, $templateName = '')
                        }\r
                        $data = array(\r
                                'id'                    => listplug_nextBatchId(),\r
-                               'memberid'              => $current->mnumber,\r
-                               'mailaddress'   => Entity::hsc($current->memail),\r
+                               'memberid'              => $current['mnumber'],\r
+                               'mailaddress'   => Entity::hsc($current['memail']),\r
                                'tabindex'              => $vars['tabindex'],\r
-                               'name'                  => Entity::hsc($current->mname),\r
-                               'realname'              => Entity::hsc($current->mrealname),\r
-                               'url'                   => Entity::hsc($current->murl),\r
-                               'admin'                 => ($current->madmin ? _YES : _NO),\r
-                               'login'                 => ($current->mcanlogin ? _YES : _NO),\r
+                               'name'                  => Entity::hsc($current['mname']),\r
+                               'realname'              => Entity::hsc($current['mrealname']),\r
+                               'url'                   => Entity::hsc($current['murl']),\r
+                               'admin'                 => $current['madmin'] ? _YES : _NO,\r
+                               'login'                 => $current['mcanlogin'] ? _YES : _NO,\r
                                'editbtn'               => _LISTS_EDIT,\r
                                'deletebtn'             => _LISTS_DELETE,\r
                        );\r
@@ -311,14 +277,14 @@ function listplug_table_memberlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_teamlist($vars, $type, $templateName = '')\r
+function listplug_table_teamlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -360,19 +326,20 @@ function listplug_table_teamlist($vars, $type, $templateName = '')
                        {\r
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_TEAMLIST_BODY'];\r
                        }\r
-                       $url  = 'index.php?action=teamchangeadmin&memberid=' . intval($current->tmember) . '&blogid=' . intval($current->tblog);\r
+                       $url  = 'index.php?action=teamchangeadmin&memberid=' . intval($current['tmember']) . '&blogid=' . intval($current['tblog']);\r
                        $url  = $manager->addTicketToUrl($url);\r
                        $data = array(\r
                                        'id'                    => listplug_nextBatchId(),\r
-                                       'memberid'              => $current->tmember,\r
-                                       'mailaddress'   => Entity::hsc($current->memail),\r
+                                       'memberid'              => $current['tmember'],\r
+                                       'mailaddress'   => Entity::hsc($current['memail']),\r
                                        'tabindex'              => $vars['tabindex'],\r
-                                       'name'                  => Entity::hsc($current->mname),\r
-                                       'realname'              => Entity::hsc($current->mrealname),\r
-                                       'admin'                 => ($current->tadmin ? _YES : _NO),\r
-                                       'blogid'                => $current->tblog,\r
-                                       'deletebtn'             => _LISTS_DELETE,\r
+                                       'name'                  => Entity::hsc($current['mname']),\r
+                                       'realname'              => Entity::hsc($current['mrealname']),\r
+                                       'admin'                 => ($current['tadmin'] ? _YES : _NO),\r
+                                       'blogid'                => $current['tblog'],\r
+                                       'deletebtn'             => '<%text(_LISTS_DELETE)%>',\r
                                        'chadminurl'    => Entity::hsc($url),\r
+                                       'chadminbtn'    => '<%text(_LIST_TEAM_CHADMIN)%>'\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -390,15 +357,15 @@ function listplug_table_teamlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_pluginlist($vars, $type, $templateName = '')\r
+function listplug_table_pluginlist($vars, $type, $template_name = '')\r
 {\r
        static $plugins = array();\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -422,8 +389,8 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                        break;\r
                case 'BODY':\r
                        $current = $vars['current'];\r
-\r
-                       $plug =& $manager->getPlugin($current->pfile);\r
+                       \r
+                       $plug =& $manager->getPlugin($current['pfile']);\r
                        if ( $plug )\r
                        {\r
                                if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_BODY']) )\r
@@ -550,7 +517,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                                $depList = $preq->getPluginDep();\r
                                                foreach ( $depList as $depName )\r
                                                {\r
-                                                       if ( $current->pfile == $depName )\r
+                                                       if ( $current['pfile'] == $depName )\r
                                                        {\r
                                                                $req[] = $plugin['pfile'];\r
                                                        }\r
@@ -590,7 +557,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                        $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLISTFALSE'];\r
                                }\r
                                $data = array(\r
-                                       'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current->pfile)),\r
+                                       'noplugalert' => sprintf(_PLUGINFILE_COULDNT_BELOADED, Entity::hsc($current['pfile'])),\r
                                );\r
                        }\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN']) )\r
@@ -609,7 +576,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                $template .= $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_ACTN'];\r
                        }\r
                        \r
-                       $baseUrl        = 'index.php?plugid=' . $current->pid . '&action=';\r
+                       $baseUrl        = 'index.php?plugid=' . $current['pid'] . '&action=';\r
                        $upUrl          = $manager->addTicketToUrl($baseUrl . 'pluginup');\r
                        $downUrl        = $manager->addTicketToUrl($baseUrl . 'plugindown');\r
                        \r
@@ -618,7 +585,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                        $data['actiondowntxt']  = _LIST_PLUGS_DOWN;\r
                        $data['actiondownurl']  = Entity::hsc($downUrl);\r
                        $data['actuninsttxt']   = _LIST_PLUGS_UNINSTALL;\r
-                       $data['actuninsturl']   = 'index.php?action=plugindelete&amp;plugid=' . $current->pid;\r
+                       $data['actuninsturl']   = 'index.php?action=plugindelete&amp;plugid=' . $current['pid'];\r
                        \r
                        if ( $plug && ($plug->hasAdminArea() > 0) )\r
                        {\r
@@ -652,7 +619,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                        $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGLIST_HELP'];\r
                                }\r
                                $subData = array(\r
-                                       'acthelpurl'    => 'index.php?action=pluginhelp&amp;plugid=' . $current->pid,\r
+                                       'acthelpurl'    => 'index.php?action=pluginhelp&amp;plugid=' . $current['pid'],\r
                                        'tabindex'              => $vars['tabindex'],\r
                                        'acthelptxt'    => _LIST_PLUGS_HELP,\r
                                );\r
@@ -669,7 +636,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                  . 'WHERE '\r
                                  . '    ocontext = "global" '\r
                                  . 'AND opid     = %d';\r
-                       $pOptions = DB::getValue(sprintf($optQuery, $current->pid));\r
+                       $pOptions = DB::getValue(sprintf($optQuery, $current['pid']));\r
                        if ( $pOptions > 0 )\r
                        {\r
                                if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL']) )\r
@@ -681,7 +648,7 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
                                        $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_PLUGOPTSETURL'];\r
                                }\r
                                $subData = array(\r
-                                       'actoptionurl'  => 'index.php?action=pluginoptions&amp;plugid=' . $current->pid,\r
+                                       'actoptionurl'  => 'index.php?action=pluginoptions&amp;plugid=' . $current['pid'],\r
                                        'tabindex'              => $vars['tabindex'],\r
                                        'actoptiontxt'  => _LIST_PLUGS_OPTIONS,\r
                                );\r
@@ -707,14 +674,14 @@ function listplug_table_pluginlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_plugoptionlist($vars, $type, $templateName = '')\r
+function listplug_table_plugoptionlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -736,7 +703,7 @@ function listplug_table_plugoptionlist($vars, $type, $templateName = '')
                        break;\r
                case 'BODY':\r
                        $current = $vars['current'];\r
-                       $template = listplug_plugOptionRow($current, $templateName);\r
+                       $template = listplug_plugOptionRow($current, $template_name);\r
                        $data = array();\r
                        break;\r
                case 'FOOT':\r
@@ -763,14 +730,14 @@ function listplug_table_plugoptionlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_plugOptionRow($current, $templateName = '')\r
+function listplug_plugOptionRow($current, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        $varname = "plugoption[{$current['oid']}][{$current['contextid']}]";\r
@@ -800,7 +767,7 @@ function listplug_plugOptionRow($current, $templateName = '')
                switch($current['type'])\r
                {\r
                        case 'yesno':\r
-                               $template .= AdminActions::input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $templateName, 1);\r
+                               $template .= listplug_input_yesno($varname, $current['value'], 0, 'yes', 'no', _YES, _NO, 0, $template_name, 1);\r
                                break;\r
                        case 'password':\r
                                if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OPWORD']) )\r
@@ -957,16 +924,87 @@ function listplug_plugOptionRow($current, $templateName = '')
        return Template::fill($template, $data, 1);\r
 }\r
 \r
-function listplug_table_itemlist($vars, $type, $templateName = '')\r
+/**\r
+ * listplug_templateEditRow()\r
+ * \r
+ * @param      array   $content                content of target template\r
+ * @param      string  $desc                   description of target template\r
+ * @param      string  $name                   name of target template\r
+ * @param      string  $help                   help text\r
+ * @param      integer $tabindex               a number for tab index\r
+ * @param      boolean $big                    large or small textarea\r
+ * @param      array   $template_name  name of template for filling\r
+ * @return     void\r
+ */\r
+function listplug_templateEditRow($content, $desc, $name, $help = '', $tabindex = 0, $big = 0, $template_name = '')\r
+{\r
+       global $manager;\r
+       \r
+       static $count = 0;\r
+       \r
+       $tmplt = array();\r
+       $base  = array();\r
+       \r
+       $templates = array();\r
+       if ( $template_name )\r
+       {\r
+               $templates =& $manager->getTemplate($template_name);\r
+       }\r
+       \r
+       $data = array(\r
+               'description'   => $desc,\r
+               'help'                  => empty($help) ? '' : helpHtml('template' . $help),\r
+               'count'                 => $count++,\r
+               'name'                  => $name,\r
+               'tabindex'              => $tabindex,\r
+               'rows'                  => $big ? 10 : 5,\r
+       );\r
+       \r
+       $message = '';\r
+       \r
+       /* row head */\r
+       if ( !array_key_exists('TEMPLATE_EDIT_ROW_HEAD', $templates) || empty($tmplt['TEMPLATE_EDIT_ROW_HEAD']) )\r
+       {\r
+               $template = "</tr>"\r
+                         . "<tr>\n"\r
+                         . "<td><%description%><%help%></td>\n"\r
+                         . "<td id=\"td<%count%>\">\n"\r
+                         . "<textarea class=\"templateedit\" name=\"<%name%>\" tabindex=\"<%tabindex%>\" cols=\"50\" rows=\"<%rows%>\" id=\"textarea<%count%>\">";\r
+       }\r
+       else\r
+       {\r
+               $template = $tmplt['TEMPLATE_EDIT_ROW_HEAD'];\r
+       }\r
+       $message .= TEMPLATE::fill($template, $data);\r
+       \r
+       /* row content */\r
+       $message .= ENTITY::hsc($content);\r
+       \r
+       /* row tail */\r
+       if ( !array_key_exists('TEMPLATE_EDIT_ROW_TAIL', $templates) || empty($tmplt['TEMPLATE_EDIT_ROW_TAIL']) )\r
+       {\r
+               $template = "</textarea>\n"\r
+                         . "</td>\n";\r
+       }\r
+       else\r
+       {\r
+               $template = $tmplt['TEMPLATE_EDIT_ROW_TAIL'];\r
+       }\r
+       $message .= TEMPLATE::fill($template, $data);\r
+       \r
+       return $message;\r
+}\r
+\r
+function listplug_table_itemlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $cssclass  = '';\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -991,7 +1029,7 @@ function listplug_table_itemlist($vars, $type, $templateName = '')
                case 'BODY':\r
                        $current = $vars['current'];\r
                        // string -> unix timestamp\r
-                       $current->itime = strtotime($current->itime);\r
+                       $current['itime'] = strtotime($current['itime']);\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY']) )\r
                        {\r
                                $template = "<td<%cssclass%>>\n"\r
@@ -1001,10 +1039,12 @@ function listplug_table_itemlist($vars, $type, $templateName = '')
                                          . "<%itemdatelabel%> <%itemdateval%><br />\n"\r
                                          . "<%itemtimelabel%> <%itemtimeval%>\n"\r
                                          . "</td>\n"\r
-                                         . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"\r
+                                         . "<td<%cssclass%>>\n"\r
+                                         . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%itemid%>\" />\n"\r
                                          . "<label for=\"batch<%batchid%>\"><b><%itemtitle%></b></label><br />\n"\r
                                          . "<%itembody%>\n"\r
-                                         . "</td><td>"\r
+                                         . "</td>\n"\r
+                                         . "<td<%cssclass%>>\n"\r
                                          . "<a href=\"index.php?action=itemedit&amp;itemid=<%itemid%>\"><%editbtn%></a><br />\n"\r
                                          . "<%camount%>\n"\r
                                          . "<a href=\"index.php?action=itemmove&amp;itemid=<%itemid%>\"><%movebtn%></a><br />\n"\r
@@ -1016,48 +1056,48 @@ function listplug_table_itemlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_ITEMLIST_BODY'];\r
                        }\r
                        $cssclass  = '';\r
-       \r
-                       if ( $current->idraft == 1 )\r
+                       \r
+                       if ( $current['idraft'] == 1 )\r
                        {\r
                                $cssclass = ' class="draft"';\r
                        }\r
                        \r
                        // (can't use offset time since offsets might vary between blogs)\r
-                       if ( $current->itime > $vars['now'] )\r
+                       if ( $current['itime'] > $vars['now'] )\r
                        {\r
                                $cssclass = ' class="future"';\r
                        }\r
-                       $body = strip_tags($current->ibody);\r
+                       $body = strip_tags($current['ibody']);\r
                        $data = array(\r
                                'cssclass'                      => $cssclass,\r
                                'bshortlabel'           => _LIST_ITEM_BLOG,\r
-                               'bshortnameval'         => Entity::hsc($current->bshortname),\r
+                               'bshortnameval'         => Entity::hsc($current['bshortname']),\r
                                'categorylabel'         => _LIST_ITEM_CAT,\r
-                               'categorynameval'       => Entity::hsc($current->cname),\r
+                               'categorynameval'       => Entity::hsc($current['cname']),\r
                                'authorlabel'           => _LIST_ITEM_AUTHOR,\r
-                               'authornameval'         => Entity::hsc($current->mname),\r
+                               'authornameval'         => Entity::hsc($current['mname']),\r
                                'itemdatelabel'         => _LIST_ITEM_DATE,\r
-                               'itemdateval'           => date("Y-m-d",$current->itime),\r
+                               'itemdateval'           => date("Y-m-d",$current['itime']),\r
                                'itemdatelabel'         => _LIST_ITEM_TIME,\r
-                               'itemdateval'           => date("H:i",$current->itime),\r
+                               'itemdateval'           => date("H:i",$current['itime']),\r
                                'batchid'                       => listplug_nextBatchId(),\r
-                               'itemid'                        => $current->inumber,\r
-                               'itemtitle'                     => Entity::hsc(strip_tags($current->ititle)),\r
+                               'itemid'                        => $current['inumber'],\r
+                               'itemtitle'                     => Entity::hsc(strip_tags($current['ititle'])),\r
                                'itembody'                      => Entity::hsc(Entity::shorten($body, 300, '...')),\r
                                'editbtn'                       => _LISTS_EDIT,\r
                                'movebtn'                       => _LISTS_MOVE,\r
                                'delbtn'                        => _LISTS_DELETE,\r
                        );\r
                        // evaluate amount of comments for the item\r
-                       $comment = new Comments($current->inumber);\r
+                       $comment = new Comments($current['inumber']);\r
                        $camount = $comment->amountComments();\r
                        if ( $camount > 0 )\r
                        {\r
-                               $data['camount'] = "<a href=\"index.php?action=itemcommentlist&amp;itemid={$current->inumber}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";\r
+                               $data['camount'] = "<a href=\"index.php?action=itemcommentlist&amp;itemid={$current['inumber']}\">(" . sprintf(_LIST_ITEM_COMMENTS, $comment->amountComments()) . ")</a><br />\n";\r
                        }\r
                        else\r
                        {\r
-                               $data['camount'] = _LIST_ITEM_NOCONTENT . "\n";\r
+                               $data['camount'] = _LIST_ITEM_NOCONTENT . "<br />\n";\r
                        }\r
                        break;\r
                case 'FOOT':\r
@@ -1082,14 +1122,14 @@ function listplug_nextBatchId()
        return $id++;\r
 }\r
 \r
-function listplug_table_commentlist($vars, $type, $templateName = '')\r
+function listplug_table_commentlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1115,12 +1155,16 @@ function listplug_table_commentlist($vars, $type, $templateName = '')
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY']) )\r
                        {\r
                                $template = "<td><%commentdate%><br /><%commentator%><br /><%commentsite%><br /><%commentmail%><br /></td>\n"\r
-                                         . "<td><input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"\r
-                                         . "<label for=\"batch<%batchid%>\"><%commentbody%></label></td>\n"\r
-                                         . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"index.php?action=commentedit&amp;commentid=<%commentid%>\"><%editbtn%></a></td>\n"\r
-                                         . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"index.php?action=commentdelete&amp;commentid=<%commentid%>\"><%delbtn%></a></td>\n"\r
+                                         . "<td>\n"\r
+                                         . "<input type=\"checkbox\" id=\"batch<%batchid%>\" name=\"batch[<%batchid%>]\" value=\"<%commentid%>\" />"\r
+                                         . "<label for=\"batch<%batchid%>\"><%commentbody%></label>\n"\r
+                                         . "</td>\n"\r
+                                         . "<td style=\"white-space:nowrap\">\n"\r
+                                         . "<a href=\"index.php?action=commentedit&amp;commentid=<%commentid%>\"><%editbtn%></a>\n"\r
+                                         . "</td>\n"\r
+                                         . "<td style=\"white-space:nowrap\">\n"\r
+                                         . "<a href=\"index.php?action=commentdelete&amp;commentid=<%commentid%>\"><%delbtn%></a>\n"\r
+                                         . "</td>\n"\r
                                          . "<%addbanlist%>";\r
                        }\r
                        else\r
@@ -1128,34 +1172,34 @@ function listplug_table_commentlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_BODY'];\r
                        }\r
                        $current = $vars['current'];\r
-                       $body = strip_tags($current->cbody);\r
+                       $body = strip_tags($current['cbody']);\r
                        $data = array(\r
-                               'commentdate'   => date("Y-m-d@H:i", strtotime($current->ctime)),\r
+                               'commentdate'   => date("Y-m-d@H:i", strtotime($current['ctime'])),\r
                                'batchid'               => listplug_nextBatchId(),\r
-                               'commentid'             => $current->cnumber,\r
-                               'commentbody'   => Entity::hsc(Entity::shorten($current->cbody, 300, '...')),\r
+                               'commentid'             => $current['cnumber'],\r
+                               'commentbody'   => Entity::hsc(Entity::shorten($current['cbody'], 300, '...')),\r
                                'editbtn'               => _LISTS_EDIT,\r
                                'delbtn'                => _LISTS_DELETE,\r
                        );\r
-                       if ( isset($current->mname) )\r
+                       if ( isset($current['mname']) )\r
                        {\r
-                               $data['commentator'] = Entity::hsc($current->mname) . ' ' . _LIST_COMMENTS_MEMBER;\r
+                               $data['commentator'] = Entity::hsc($current['mname']) . ' ' . _LIST_COMMENTS_MEMBER;\r
                        }\r
                        else\r
                        {\r
-                               $data['commentator'] = Entity::hsc($current->cuser);\r
+                               $data['commentator'] = Entity::hsc($current['cuser']);\r
                        }\r
-                       if ( isset($current->cmail) && $current->cmail )\r
+                       if ( isset($current['cmail']) && $current['cmail'] )\r
                        {\r
-                               $data['commentsite'] = Entity::hsc($current->cmail);\r
+                               $data['commentsite'] = Entity::hsc($current['cmail']);\r
                        }\r
                                else\r
                        {\r
                                $data['commentsite'] = '';\r
                        }\r
-                       if ( isset($current->cemail) && $current->cemail )\r
+                       if ( isset($current['cemail']) && $current['cemail'] )\r
                        {\r
-                               $data['commentmail'] = Entity::hsc($current->cemail);\r
+                               $data['commentmail'] = Entity::hsc($current['cemail']);\r
                        }\r
                                else\r
                        {\r
@@ -1165,15 +1209,17 @@ function listplug_table_commentlist($vars, $type, $templateName = '')
                        {\r
                                if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN']) )\r
                                {\r
-                                       $subTpl = "<td style=\"white-space:nowrap\"><a href=\"index.php?action=banlistnewfromitem&amp;itemid=<%itemid%>&amp;ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a></td>\n";\r
+                                       $subTpl = "<td style=\"white-space:nowrap\">"\r
+                                               . "<a href=\"index.php?action=banlistnewfromitem&amp;itemid=<%itemid%>&amp;ip=<%banip%>\" title=\"<%banhost%>\"><%banbtn%></a>"\r
+                                               . "</td>\n";\r
                                }\r
                                else\r
                                {\r
                                        $subTpl = $templates['SHOWLIST_LISTPLUG_TABLE_CMNTLIST_ABAN'];\r
                                }\r
                                $subData = array(\r
-                                       'itemid'        => $current->citem,\r
-                                       'banip'         => Entity::hsc($current->cip),\r
+                                       'itemid'        => $current['citem'],\r
+                                       'banip'         => Entity::hsc($current['cip']),\r
                                        'banbtn'        => _LIST_COMMENT_BANIP,\r
                                );\r
                                $data['addbanlist'] = Template::fill($subTpl, $subData);\r
@@ -1194,14 +1240,14 @@ function listplug_table_commentlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_bloglist($vars, $type, $templateName = '')\r
+function listplug_table_bloglist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1237,10 +1283,10 @@ function listplug_table_bloglist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_BODY'];\r
                        }\r
                        $data = array(\r
-                               'blogid'                => $current->bnumber,\r
-                               'shortname'             => Entity::hsc($current->bshortname),\r
-                               'blogurl'               => $current->burl,\r
-                               'blogname'              => Entity::hsc($current->bname),\r
+                               'blogid'                => $current['bnumber'],\r
+                               'shortname'             => Entity::hsc($current['bshortname']),\r
+                               'blogurl'               => $current['burl'],\r
+                               'blogname'              => Entity::hsc($current['bname']),\r
                                'ttaddtext'             => _BLOGLIST_TT_ADD,\r
                                'addtext'               => _BLOGLIST_ADD,\r
                                'ttedittext'    => _BLOGLIST_TT_EDIT,\r
@@ -1250,12 +1296,12 @@ function listplug_table_bloglist($vars, $type, $templateName = '')
                                'ttbmlettext'   => _BLOGLIST_TT_BMLET,\r
                                'bmlettext'             => _BLOGLIST_BMLET,\r
                        );\r
-                       if ( $current->tadmin == 1 )\r
+                       if ( $current['tadmin'] == 1 )\r
                        {\r
                                if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLIST_BD_TADM']) )\r
                                {\r
                                        $template .= "<td><a href=\"index.php?action=blogsettings&amp;blogid=<%blogid%>\" title=\"<%ttsettingtext%>\"><%settingtext%></a></td>\n"\r
-                                                 . "<td><a href=\"index.php?action=banlist&amp;blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";\r
+                                                  . "<td><a href=\"index.php?action=banlist&amp;blogid=<%blogid%>\" title=\"<%ttbanstext%>\"><%banstext%></a></td>\n";\r
                                }\r
                                else\r
                                {\r
@@ -1282,7 +1328,6 @@ function listplug_table_bloglist($vars, $type, $templateName = '')
                        }\r
                        break;\r
                case 'FOOT':\r
-                       $current = $vars['current'];\r
                        if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_BLOGLIST_FOOT']) )\r
                        {\r
                                $template = "\n";\r
@@ -1297,14 +1342,14 @@ function listplug_table_bloglist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_shortblognames($vars, $type, $templateName = '')\r
+function listplug_table_shortblognames($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1336,8 +1381,8 @@ function listplug_table_shortblognames($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_BLOGSNAM_BODY'];\r
                        }\r
                        $data = array(\r
-                               'bshortname' => Entity::hsc($current->bshortname),\r
-                               'blogname'   => Entity::hsc($current->bname),\r
+                               'bshortname' => Entity::hsc($current['bshortname']),\r
+                               'blogname'   => Entity::hsc($current['bname']),\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -1356,14 +1401,14 @@ function listplug_table_shortblognames($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_shortnames($vars, $type, $templateName = '')\r
+function listplug_table_shortnames($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1395,8 +1440,8 @@ function listplug_table_shortnames($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_SHORTNAM_BODY'];\r
                        }\r
                        $data = array(\r
-                               'name' => Entity::hsc($current->name),\r
-                               'desc' => Entity::hsc($current->description),\r
+                               'name' => Entity::hsc($current['name']),\r
+                               'desc' => Entity::hsc($current['description']),\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -1415,14 +1460,14 @@ function listplug_table_shortnames($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_categorylist($vars, $type, $templateName = '')\r
+function listplug_table_categorylist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1463,10 +1508,10 @@ function listplug_table_categorylist($vars, $type, $templateName = '')
                        \r
                        $data = array(\r
                                'batchid'       => listplug_nextBatchId(),\r
-                               'catid'         => intval($current->catid),\r
-                               'catname'       => Entity::hsc($current->cname),\r
-                               'catdesc'       => Entity::hsc($current->cdesc),\r
-                               'blogid'        => intval($current->cblog),\r
+                               'catid'         => intval($current['catid']),\r
+                               'catname'       => Entity::hsc($current['cname']),\r
+                               'catdesc'       => Entity::hsc($current['cdesc']),\r
+                               'blogid'        => intval($current['cblog']),\r
                                'tabindex'      => intval($vars['tabindex']),\r
                                'editbtn'       => _LISTS_EDIT,\r
                                'delbtn'        => _LISTS_DELETE,\r
@@ -1487,14 +1532,14 @@ function listplug_table_categorylist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_templatelist($vars, $type, $templateName = '')\r
+function listplug_table_templatelist($vars, $type, $template_name = '')\r
 {\r
        global $manager, $CONF;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1537,22 +1582,23 @@ function listplug_table_templatelist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];\r
                        }\r
                        \r
-                       $deleteurl      = "{$CONF['AdminURL']}index.php?action=templatedelete&templateid={$current->tdnumber}";\r
-                       $editurl        = "{$CONF['AdminURL']}index.php?action=templateedit&templateid={$current->tdnumber}";\r
-                       $cloneurl       = "{$CONF['AdminURL']}index.php?action=templateclone&templateid={$current->tdnumber}";\r
-                       \r
                        $data = array(\r
-                               'templatename'  => Entity::hsc($current->tdname),\r
-                               'templatedesc'  => Entity::hsc($current->tddesc),\r
-                               'templateid'    => (integer) $current->tdnumber,\r
+                               'templatename'  => Entity::hsc($current['tdname']),\r
+                               'templatedesc'  => Entity::hsc($current['tddesc']),\r
+                               'templateid'    => (integer) $current['tdnumber'],\r
                                'tabindex'              => (integer) $vars['tabindex'],\r
-                               'deleteurl'             => Entity::hsc($manager->addTicketToUrl($deleteurl)),\r
-                               'editurl'               => Entity::hsc($manager->addTicketToUrl($editurl)),\r
-                               'cloneurl'              => Entity::hsc($manager->addTicketToUrl($cloneurl)),\r
-                               'editbtn'               => _LISTS_EDIT,\r
+                               \r
                                'clonebtn'              => _LISTS_CLONE,\r
+                               'cloneaction'   => $vars['cloneaction'],\r
+                               'cloneurl'              => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&amp;templateid={$current['tdnumber']}",\r
+                               \r
                                'delbtn'                => _LISTS_DELETE,\r
-                               'adminflg'              => '',\r
+                               'deleteaction'  => $vars['deleteaction'],\r
+                               'deleteurl'             => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&amp;templateid={$current['tdnumber']}",\r
+                               \r
+                               'editbtn'               => _LISTS_EDIT,\r
+                               'editaction'    => $vars['editaction'],\r
+                               'editurl'               => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&amp;templateid={$current['tdnumber']}"\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -1570,14 +1616,14 @@ function listplug_table_templatelist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_skinlist($vars, $type, $templateName = '')\r
+function listplug_table_skinlist($vars, $type, $template_name = '')\r
 {\r
        global $CONF, $DIR_SKINS, $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1611,73 +1657,78 @@ function listplug_table_skinlist($vars, $type, $templateName = '')
                                          . "<%readme%></td>\n"\r
                                          . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"\r
                                          . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"index.php?action=skinedit&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"\r
-                                         . "</a></td>\n"\r
+                                         . "<a href=\"index.php?action=skinedit&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>"\r
+                                         . "</td>\n"\r
                                          . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"\r
-                                         . "</a></td>\n"\r
+                                         . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>"\r
+                                         . "</td>\n"\r
                                          . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"index.php?action=skindelete&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"\r
-                                         . "</a></td>\n";\r
+                                         . "<a href=\"index.php?action=skindelete&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>"\r
+                                         . "</td>\n";\r
                        }\r
                        else\r
                        {\r
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];\r
                        }\r
                        \r
-                       $editurl        = "{$CONF['AdminURL']}index.php?action=skinedit&skinid={$current->sdnumber}";\r
-                       $cloneurl       = "{$CONF['AdminURL']}index.php?action=skinclone&skinid={$current->sdnumber}";\r
-                       $deleteurl      = "{$CONF['AdminURL']}index.php?action=skindelete&skinid={$current->sdnumber}";\r
-                       \r
                        $data = array(\r
+                               'tabindex'              => $vars['tabindex']++,\r
+                               \r
+                               'skinid'                => (integer) $current['sdnumber'],\r
+                               'skindesc'              => Entity::hsc($current['sddesc']),\r
+                               \r
                                'skintypelabel' => _LISTS_TYPE,\r
-                               'skintype'              => Entity::hsc($current->sdtype),\r
+                               'skintype'              => Entity::hsc($current['sdtype']),\r
+                               \r
                                'incmodelabel'  => _LIST_SKINS_INCMODE,\r
-                               'incmode'               => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,\r
-                               'incpreflabel'  => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',\r
-                               'incpref'               => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',\r
-                               'skindesc'              => Entity::hsc($current->sddesc),\r
-                               'skinid'                => (integer) $current->sdnumber,\r
-                               'tabindex'              => $vars['tabindex'],\r
-                               'editurl'               => Entity::hsc($manager->addTicketToUrl($editurl)),\r
-                               'cloneurl'              => Entity::hsc($manager->addTicketToUrl($cloneurl)),\r
-                               'deleteurl'             => Entity::hsc($manager->addTicketToUrl($deleteurl)),\r
+                               'incmode'               => ($current['sdincmode'] == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,\r
+                               \r
+                               'incpreflabel'  => ($current['sdincpref']) ? _LIST_SKINS_INCMODE : '',\r
+                               'incpref'               => ($current['sdincpref']) ? Entity::hsc($current['sdincpref']) : '',\r
+                               \r
                                'editbtn'               => _LISTS_EDIT,\r
+                               'editaction'    => $vars['editaction'],\r
+                               'editurl'               => "{$CONF['AdminURL']}index.php?action={$vars['editaction']}&skinid={$current['sdnumber']}",\r
+                               \r
                                'clonebtn'              => _LISTS_CLONE,\r
+                               'cloneaction'   => $vars['cloneaction'],\r
+                               'cloneurl'              => "{$CONF['AdminURL']}index.php?action={$vars['cloneaction']}&skinid={$current['sdnumber']}",\r
+                               \r
                                'delbtn'                => _LISTS_DELETE,\r
+                               'deleteaction'  => $vars['deleteaction'],\r
+                               'deleteurl'             => "{$CONF['AdminURL']}index.php?action={$vars['deleteaction']}&skinid={$current['sdnumber']}"\r
                        );\r
                        \r
-                       // use a special style for the default skin\r
-                       if ( $current->sdnumber != $CONF['BaseSkin'] )\r
+                       if ( $current['sdnumber'] != $vars['default'] )\r
                        {\r
-                               $data['skinname'] = Entity::hsc($current->sdname);\r
+                               $data['skinname'] = Entity::hsc($current['sdname']);\r
                        }\r
                        else\r
                        {\r
-                               $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';\r
+                               $data['skinname'] = '<strong>' . Entity::hsc($current['sdname']) . '</strong>';\r
                        }\r
                        \r
                        // add preview image when present\r
-                       if ( $current->sdincpref && @file_exists("{$DIR_SKINS}{$current->sdincpref}preview.png") )\r
+                       if ( $current['sdincpref'] && @file_exists("{$DIR_SKINS}{$current['sdincpref']}preview.png") )\r
                        {\r
                                $data['skinthumb'] = "<p>\n";\r
                                \r
-                               $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);\r
-                               $has_enlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');\r
+                               $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current['sdname']);\r
+                               $has_enlargement = @file_exists($DIR_SKINS . $current['sdincpref'] . 'preview-large.png');\r
                                if ( $has_enlargement )\r
                                {\r
-                                       $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";\r
+                                       $data['skinthumb'] .= '<a href="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";\r
                                }\r
-                               $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";\r
+                               $data['skinthumb'] .= '<img class="skinpreview" src="' . $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";\r
                                if ( $has_enlargement )\r
                                {\r
                                        $data['skinthumb'] .= "</a><br />\n";\r
                                }\r
                                \r
-                               if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )\r
+                               if ( @file_exists("{$DIR_SKINS}{$current['sdincpref']}readme.html") )\r
                                {\r
-                                       $url = $CONF['SkinsURL'] . Entity::hsc($current->sdincpref) . 'readme.html';\r
-                                       $title = sprintf(_LIST_SKIN_README, $current->sdname);\r
+                                       $url = $CONF['SkinsURL'] . Entity::hsc($current['sdincpref']) . 'readme.html';\r
+                                       $title = sprintf(_LIST_SKIN_README, $current['sdname']);\r
                                        $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";\r
                                }\r
                                else\r
@@ -1688,16 +1739,23 @@ function listplug_table_skinlist($vars, $type, $templateName = '')
                                $data['skinthumb'] .=  "</p>\n";\r
                        }\r
                        \r
-                       $skin = new Skin($current->sdnumber);\r
-                       $available_skin_types = $skin->getAvailableTypes();\r
+                       if ( !preg_match('#^admin#', $current['sdname']) )\r
+                       {\r
+                               $skin = new Skin($current['sdnumber']);\r
+                       }\r
+                       else\r
+                       {\r
+                               $skin = new Skin($current['sdnumber'], 'AdminActions');\r
+                       }\r
+                       $available_types = $skin->getAvailableTypes();\r
                        \r
-                       $data['skinparts']  = _LIST_SKINS_DEFINED;\r
-                       $data['skinparts'] .= "<ul>\n";\r
-                       foreach ( $available_skin_types as $type => $friendlyName )\r
+                       $data['skinparts'] = _LIST_SKINS_DEFINED\r
+                                          . "<ul>\n";\r
+                       foreach ( $available_types as $type => $label )\r
                        {\r
-                               if ( $friendlyName === FALSE )\r
+                               if ( $label === FALSE )\r
                                {\r
-                                       $friendlyName = ucfirst($type);\r
+                                       $label = ucfirst($type);\r
                                        $article = 'skinpartspecial';\r
                                }\r
                                else\r
@@ -1706,8 +1764,8 @@ function listplug_table_skinlist($vars, $type, $templateName = '')
                                }\r
                                $data['skinparts'] .= "<li>\n"\r
                                                   . helpHtml($article) . "\n"\r
-                                                  . "<a href=\"index.php?action=skinedittype&amp;skinid={$current->sdnumber}&amp;type={$type}\" tabindex=\"{$vars['tabindex']}\">"\r
-                                                  . Entity::hsc($friendlyName)\r
+                                                  . "<a href=\"{$CONF['AdminURL']}index.php?action={$vars['edittypeaction']}&amp;skinid={$current['sdnumber']}&amp;type={$type}\" tabindex=\"{$vars['tabindex']}\">"\r
+                                                  . Entity::hsc($label)\r
                                                   . "</a>\n"\r
                                                   . "</li>\n";\r
                        }\r
@@ -1728,14 +1786,14 @@ function listplug_table_skinlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_draftlist($vars, $type, $templateName = '')\r
+function listplug_table_draftlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        switch( $type )\r
        {\r
@@ -1770,9 +1828,9 @@ function listplug_table_draftlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_DRFTLIST_BODY'];\r
                        }\r
                        $data = array(\r
-                               'bshortname'    => Entity::hsc($current->bshortname),\r
-                               'ititle'                => Entity::hsc(strip_tags($current->ititle)),\r
-                               'itemid'                => intval($current->inumber),\r
+                               'bshortname'    => Entity::hsc($current['bshortname']),\r
+                               'ititle'                => Entity::hsc(strip_tags($current['ititle'])),\r
+                               'itemid'                => intval($current['inumber']),\r
                                'editbtn'               => _LISTS_EDIT,\r
                                'delbtn'                => _LISTS_DELETE,\r
                        );\r
@@ -1792,14 +1850,14 @@ function listplug_table_draftlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_otherdraftlist($vars, $type, $templateName = '')\r
+function listplug_table_otherdraftlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1838,10 +1896,10 @@ function listplug_table_otherdraftlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_ODRFTLIST_BODY'];\r
                        }\r
                        $data = array(\r
-                               'bshortname'    => Entity::hsc($current->bshortname),\r
-                               'ititle'                => Entity::hsc(strip_tags($current->ititle)),\r
-                               'iauthor'               => Entity::hsc(strip_tags($current->mname)),\r
-                               'itemid'                => intval($current->inumber),\r
+                               'bshortname'    => Entity::hsc($current['bshortname']),\r
+                               'ititle'                => Entity::hsc(strip_tags($current['ititle'])),\r
+                               'iauthor'               => Entity::hsc(strip_tags($current['mname'])),\r
+                               'itemid'                => intval($current['inumber']),\r
                                'editbtn'               => _LISTS_EDIT,\r
                                'delbtn'                => _LISTS_DELETE,\r
                        );\r
@@ -1861,14 +1919,14 @@ function listplug_table_otherdraftlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_actionlist($vars, $type, $templateName = '')\r
+function listplug_table_actionlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1900,8 +1958,8 @@ function listplug_table_actionlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_ACTNLIST_BODY'];\r
                        }\r
                        $data = array(\r
-                               'timestamp'     => Entity::hsc($current->timestamp),\r
-                               'message'       => Entity::hsc($current->message),\r
+                               'timestamp'     => Entity::hsc($current['timestamp']),\r
+                               'message'       => Entity::hsc($current['message']),\r
                        );\r
                        break;\r
                case 'FOOT':\r
@@ -1920,14 +1978,14 @@ function listplug_table_actionlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_banlist($vars, $type, $templateName = '')\r
+function listplug_table_banlist($vars, $type, $template_name = '')\r
 {\r
        global $manager;\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( !empty($template_name) )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
        switch( $type )\r
@@ -1962,9 +2020,9 @@ function listplug_table_banlist($vars, $type, $templateName = '')
                                $template = $templates['SHOWLIST_LISTPLUG_TABLE_IBANLIST_BODY'];\r
                        }\r
                        $data = array(\r
-                               'iprange'       => Entity::hsc($current->iprange),\r
-                               'reason'        => Entity::hsc($current->reason),\r
-                               'blogid'        => intval($current->blogid),\r
+                               'iprange'       => Entity::hsc($current['iprange']),\r
+                               'reason'        => Entity::hsc($current['reason']),\r
+                               'blogid'        => intval($current['blogid']),\r
                                'delbtn'        => _LISTS_DELETE,\r
                        );\r
                        break;\r
@@ -1984,243 +2042,409 @@ function listplug_table_banlist($vars, $type, $templateName = '')
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_adminskinlist($vars, $type, $templateName = '')\r
+/**\r
+ * listplug_list_normalskinlist()\r
+ * \r
+ * @param      array   $vars                   array for variables\r
+ * @param      string  $type                   HEAD/BODY/FOOT\r
+ * @param      string  $template_name  name of template\r
+ * @return     string  marked-up string\r
+ */\r
+function listplug_list_normalskinlist($vars, $type, $template_name = '')\r
 {\r
-       global $CONF, $DIR_SKINS, $DIR_NUCLEUS, $manager;\r
+       global $manager, $CONF;\r
        \r
-       $adminSkinURL  = $CONF['SkinsURL'] . 'admin/';\r
-       $adminSkinDir  = $DIR_SKINS . 'admin/';\r
+       /* available variables as a default */\r
+       $data = array(\r
+               'skinid'        => (integer) $vars['skinid'],\r
+               'skinname'      => Entity::hsc($vars['skinname']),\r
+       );\r
        \r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( $template_name )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
-       switch( $type )\r
+       \r
+       switch ( $type )\r
        {\r
                case 'HEAD':\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD']) )\r
+                       if ( !array_key_exists('NORMALSKINLIST_HEAD', $templates) || empty($templates['NORMALSKINLIST_HEAD']) )\r
                        {\r
-                               $template = "<th><%colname%></th>\n"\r
-                                         . "<th><%coldesc%></th>\n"\r
-                                         . "<th colspan=\"3\"><%colact%></th>\n";\r
+                               $template = "<ul>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_HEAD'];\r
+                               $template = $templates['NORMALSKINLIST_HEAD'];\r
                        }\r
-                       $data = array(\r
-                                       'colname'       => _LISTS_NAME,\r
-                                       'coldesc'       => _LISTS_DESC,\r
-                                       'colact'        => _LISTS_ACTIONS,\r
-                       );\r
+                       \r
                        break;\r
                case 'BODY':\r
                        $current = $vars['current'];\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY']) )\r
+                       if ( !array_key_exists('NORMALSKINLIST_BODY', $templates) || empty($templates['NORMALSKINLIST_BODY']) )\r
                        {\r
-                               $template = "<td><%skinname%><br /><br />\n"\r
-                               . "<%skintypelabel%> <%skintype%><br />\n"\r
-                               . "<%incmodelabel%> <%incmode%><br />\n"\r
-                               . "<%incpreflabel%> <%incpref%><br />\n"\r
-                               . "<%skinthumb%>"\r
-                               . "<%readme%></td>\n"\r
-                               . "<td class=\"availableSkinTypes\"><%skindesc%><%skinparts%></td>\n"\r
-                               . "<td style=\"white-space:nowrap\">"\r
-                               . "<a href=\"index.php?action=adminskinedit&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%editbtn%>"\r
-                               . "</a></td>\n"\r
-                               . "<td style=\"white-space:nowrap\">"\r
-                               . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%>"\r
-                               . "</a></td>\n"\r
-                               . "<td style=\"white-space:nowrap\">"\r
-                               . "<a href=\"index.php?action=adminskindelete&amp;skinid=<%skinid%>\" tabindex=\"<%tabindex%>\"><%delbtn%>"\r
-                               . "</a></td>\n";\r
+                               $template = "<li>"\r
+                                         . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\"><%skintypename%></a>"\r
+                                         . " <%help%>"\r
+                                         . "</li>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_BODY'];\r
+                               $template = $templates['NORMALSKINLIST_BODY'];\r
                        }\r
                        \r
-                       $editurl        = "{$CONF['AdminURL']}index.php?action=adminskinedit&skinid={$current->sdnumber}";\r
-                       $cloneurl       = "{$CONF['AdminURL']}index.php?action=adminskinclone&skinid={$current->sdnumber}";\r
-                       $deleteurl      = "{$CONF['AdminURL']}index.php?action=adminskindelete&skinid={$current->sdnumber}";\r
-                       \r
-                       $data = array(\r
-                               'skintypelabel' => _LISTS_TYPE,\r
-                               'skintype'              => Entity::hsc($current->sdtype),\r
-                               'incmodelabel'  => _LIST_SKINS_INCMODE,\r
-                               'incmode'               => ($current->sdincmode == 'skindir') ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL,\r
-                               'incpreflabel'  => ($current->sdincpref) ? _LIST_SKINS_INCMODE : '',\r
-                               'incpref'               => ($current->sdincpref) ? Entity::hsc($current->sdincpref) : '',\r
-                               'skindesc'              => Entity::hsc($current->sddesc),\r
-                               'skinid'                => (integer) $current->sdnumber,\r
-                               'tabindex'              => $vars['tabindex'],\r
-                               'editurl'               => Entity::hsc($manager->addTicketToUrl($editurl)),\r
-                               'cloneurl'              => Entity::hsc($manager->addTicketToUrl($cloneurl)),\r
-                               'deleteurl'             => Entity::hsc($manager->addTicketToUrl($deleteurl)),\r
-                               'editbtn'               => _LISTS_EDIT,\r
-                               'clonebtn'              => _LISTS_CLONE,\r
-                               'delbtn'                => _LISTS_DELETE,\r
-                       );\r
-                       \r
-                       // use a special style for the default skin\r
-                       if ( $current->sdnumber != $CONF['AdminSkin'] )\r
-                       {\r
-                               $data['skinname'] = Entity::hsc($current->sdname);\r
-                       }\r
-                       else\r
-                       {\r
-                               $data['skinname'] = '<strong>' . Entity::hsc($current->sdname) . '</strong>';\r
-                       }\r
-                       \r
-                       // add preview image when present\r
-                       if ( $current->sdincpref && @file_exists("{$adminSkinDir}{$current->sdincpref}preview.png") )\r
-                       {\r
-                               $data['skinthumb'] = "<p>\n";\r
-                               \r
-                               $alternatve_text = sprintf(_LIST_SKIN_PREVIEW, $current->sdname);\r
-                               $has_enlargement = @file_exists($adminSkinDir . $current->sdincpref . 'preview-large.png');\r
-                               if ( $has_enlargement )\r
-                               {\r
-                                       $data['skinthumb'] .= '<a href="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . "\">\n";\r
-                               }\r
-                               $data['skinthumb'] .= '<img class="skinpreview" src="' . $adminSkinURL . Entity::hsc($current->sdincpref) . 'preview.png" width="100" height="75" alt="' . $alternatve_text . "\" />\n";\r
-                               if ( $has_enlargement )\r
-                               {\r
-                                       $data['skinthumb'] .= "</a><br />\n";\r
-                               }\r
-                               \r
-                               if ( @file_exists("{$DIR_SKINS}{$current->sdincpref}readme.html") )\r
-                               {\r
-                                       $url = $adminSkinURL . Entity::hsc($current->sdincpref) . 'readme.html';\r
-                                       $title = sprintf(_LIST_SKIN_README, $current->sdname);\r
-                                       $data['readme'] = "<a href=\"{$url}\" title=\"{$title}\">" . _LIST_SKIN_README_TXT . "</a>\n";\r
-                               }\r
-                               else\r
-                               {\r
-                                       $data['readme'] ="";\r
-                               }\r
-                               \r
-                               $data['skinthumb'] .=  "</p>\n";\r
-                       }\r
-                       \r
-                       $skin = new Skin($current->sdnumber, 'AdminActions');\r
-                       $available_skin_types = $skin->getAvailableTypes();\r
-                       \r
-                       $data['skinparts']  = _LIST_SKINS_DEFINED;\r
-                       $data['skinparts'] .= "<ul>\n";\r
-                       foreach ( $available_skin_types as $type => $friendlyName )\r
-                       {\r
-                               if ( $friendlyName === FALSE )\r
-                               {\r
-                                       $friendlyName = ucfirst($type);\r
-                                       $article = 'skinpartspecial';\r
-                               }\r
-                               else\r
-                               {\r
-                                       $article = "skinpart{$type}";\r
-                               }\r
-                               $data['skinparts'] .= "<li>\n"\r
-                                                  . helpHtml($article) . "\n"\r
-                                                  . "<a href=\"index.php?action=adminskinedittype&amp;skinid={$current->sdnumber}&amp;type={$type}\" tabindex=\"{$vars['tabindex']}\">"\r
-                                                  . Entity::hsc($friendlyName)\r
-                                                  . "</a>\n"\r
-                                                  . "</li>\n";\r
-                       }\r
-                       $data['skinparts'] .= "</ul>\n";\r
+                       $data['tabindex']               = $vars['tabindex']++;\r
+                       $data['skintype']               = $current['skintype'];\r
+                       $data['skintypename']   = $current['skintypename'];\r
+                       $data['editaction']             = $vars['editaction'];\r
+                       $data['editurl']                = "{$CONF['AdminURL']}?action={$vars['editaction']}&amp;skinid={$vars['skinid']}&amp;type={$current['skintype']}";\r
+                       /* TODO: removeaction? */\r
+                       /* TODO: customHelpHtml("skinpart{$skintype}-{$template_name}") */\r
+                       $data['help']                   = '';\r
                        break;\r
                case 'FOOT':\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT']) )\r
+                       if ( !array_key_exists('NORMALSKINLIST_FOOT', $templates) || empty($templates['NORMALSKINLIST_FOOT']) )\r
                        {\r
-                               $template = "";\r
+                               $template = "</ul>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_SKINLIST_FOOT'];\r
+                               $template = $templates['NORMALSKINLIST_FOOT'];\r
                        }\r
-                       $data = array();\r
+                       \r
                        break;\r
        }\r
+       \r
        return Template::fill($template, $data);\r
 }\r
 \r
-function listplug_table_admintemplatelist($vars, $type, $templateName = '')\r
+/**\r
+ * listplug_list_specialskinlist()\r
+ * \r
+ * @param      array   $vars                   array for variables\r
+ * @param      string  $type                   HEAD/BODY/FOOT\r
+ * @param      string  $template_name  name of template\r
+ * @return     string  marked-up string\r
+ */\r
+function listplug_list_specialskinlist($vars, $type, $template_name = '')\r
 {\r
        global $manager, $CONF;\r
        \r
+       /* available variables as a default */\r
+       $data = array(\r
+               'skinid'        => (integer) $vars['skinid'],\r
+               'skinname'      => Entity::hsc($vars['skinname']),\r
+       );\r
+       \r
+       /* retrieve templates */\r
        $templates = array();\r
-       if ( !empty($templateName) )\r
+       if ( $template_name )\r
        {\r
-               $templates =& $manager->getTemplate($templateName);\r
+               $templates =& $manager->getTemplate($template_name);\r
        }\r
        \r
-       switch( $type )\r
+       switch ( $type )\r
        {\r
                case 'HEAD':\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD']) )\r
+                       if ( !array_key_exists('SPECIALSKINLIST_HEAD', $templates) || empty($templates['SPECIALSKINLIST_HEAD']) )\r
                        {\r
-                               $template = "<th><%colname%></th>\n"\r
-                                         . "<th><%coldesc%></th>\n"\r
-                                         . "<th colspan=\"3\"><%colact%></th>\n";\r
+                               $template = "<ul>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_HEAD'];\r
+                               $template = $templates['SPECIALSKINLIST_HEAD'];\r
                        }\r
-                       $data = array(\r
-                               'colname'       => _LISTS_NAME,\r
-                               'coldesc'       => _LISTS_DESC,\r
-                               'colact'        => _LISTS_ACTIONS,\r
-                       );\r
                        break;\r
                case 'BODY':\r
                        $current = $vars['current'];\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY']) )\r
+                       if ( !array_key_exists('SPECIALSKINLIST_BODY', $templates) || empty($templates['SPECIALSKINLIST_BODY']) )\r
                        {\r
-                               $template = "<td><%templatename%></td>\n"\r
-                                         . "<td><%templatedesc%></td>\n"\r
-                                         . "<td style=\"white-space:nowrap\">"\r
-                                         . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\"><%editbtn%></a>\n"\r
-                                         . "</td>\n"\r
-                                         . "<td style=\"white-space:nowrap\">\n"\r
-                                         . "<a href=\"<%cloneurl%>\" tabindex=\"<%tabindex%>\"><%clonebtn%></a>\n"\r
-                                         . "</td>\n"\r
-                                         . "<td style=\"white-space:nowrap\">\n"\r
-                                         . "<a href=\"<%deleteurl%>\" tabindex=\"<%tabindex%>\"><%delbtn%></a>\n"\r
-                                         . "</td>\n";\r
+                               $template = "<li>"\r
+                                         . "<a href=\"<%editurl%>\" tabindex=\"<%tabindex%>\">"\r
+                                         . "<%skintype%>"\r
+                                         . "</a>"\r
+                                         . " ("\r
+                                         . "<a href=\"<%removeurl%>\" tabindex=\"<%tabindex%>\" >"\r
+                                         . "<%text(_LISTS_DELETE)%>"\r
+                                         . "</a>"\r
+                                         . ")"\r
+                                         . "</li>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_BODY'];\r
+                               $template = $templates['SPECIALSKINLIST_BODY'];\r
                        }\r
-                       $deleteurl      = "{$CONF['AdminURL']}index.php?action=admintemplatedelete&templateid={$current->tdnumber}";\r
-                       $editurl        = "{$CONF['AdminURL']}index.php?action=admintemplateedit&templateid={$current->tdnumber}";\r
-                       $cloneurl       = "{$CONF['AdminURL']}index.php?action=admintemplateclone&templateid={$current->tdnumber}";\r
-                       $data = array(\r
-                               'templatename'  => Entity::hsc($current->tdname),\r
-                               'templatedesc'  => Entity::hsc($current->tddesc),\r
-                               'templateid'    => (integer) $current->tdnumber,\r
-                               'tabindex'              => (integer) $vars['tabindex'],\r
-                               'deleteurl'             => Entity::hsc($manager->addTicketToUrl($deleteurl)),\r
-                               'editurl'               => Entity::hsc($manager->addTicketToUrl($editurl)),\r
-                               'cloneurl'              => Entity::hsc($manager->addTicketToUrl($cloneurl)),\r
-                               'editbtn'               => _LISTS_EDIT,\r
-                               'clonebtn'              => _LISTS_CLONE,\r
-                               'delbtn'                => _LISTS_DELETE,\r
-                               'adminflg'              => 'admin',\r
-                       );\r
+                       \r
+                       $data['tabindex']               = (integer) $vars['tabindex']++;\r
+                       $data['skintype']               = Entity::hsc($current['skintype']);\r
+                       $data['skintypename']   = Entity::hsc($current['skintypename']);\r
+                       $data['editaction']             = $vars['editaction'];\r
+                       $data['editurl']                = "{$CONF['AdminURL']}?action={$vars['editaction']}&amp;skinid={$vars['skinid']}&amp;type={$current['skintype']}";\r
+                       $data['removeaction']   = $vars['editaction'];\r
+                       $data['removeurl']              = "{$CONF['AdminURL']}?action={$vars['removeaction']}&amp;skinid={$vars['skinid']}&amp;type={$current['skintype']}";\r
+                       \r
                        break;\r
                case 'FOOT':\r
-                       if ( !array_key_exists('SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT', $templates) || empty($templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT']) )\r
+                       if ( !array_key_exists('SPECIALSKINLIST_FOOT', $templates) || empty($templates['SPECIALSKINLIST_FOOT']) )\r
                        {\r
-                               $template = "\n";\r
+                               $template = "</ul>\n";\r
                        }\r
                        else\r
                        {\r
-                               $template = $templates['SHOWLIST_LISTPLUG_TABLE_TPLTLIST_FOOT'];\r
+                               $template = $templates['SPECIALSKINLIST_FOOT'];\r
                        }\r
-                       $data = array();\r
                        break;\r
        }\r
+       \r
        return Template::fill($template, $data);\r
 }\r
+\r
+/**\r
+ * listplug_input_yesno()\r
+ *\r
+ * @param      string  $name                   name of input element with radio type attribute\r
+ * @param      string  $checkedval             value which should be checked\r
+ * @param      integer $tabindex               tabindex number\r
+ * @param      string  $value1                 value of radio 1\r
+ * @param      string  $value2                 value of radio 2\r
+ * @param      string  $yesval                 label for yes\r
+ * @param      string  $noval                  label for no\r
+ * @param      boolean $isAdmin                super admin or not\r
+ * @param      string  $template_name  name of template\r
+ * @param      boolean $showlist               used in showlist or not\r
+ * @return     string  marked-up string\r
+ */\r
+function listplug_input_yesno($name, $checkedval, $tabindex = 0,\r
+       $value1 = 1, $value2 = 0, $yesval = _YES, $noval = _NO,\r
+       $isAdmin = 0, $template_name = '', $showlist = FALSE)\r
+{\r
+       global $manager;\r
+       \r
+       $templates = array();\r
+       if ( $template_name )\r
+       {\r
+               $templates =& $manager->getTemplate($template_name);\r
+       }\r
+       \r
+       if ( $name == 'admin' )\r
+       {\r
+               if ( !array_key_exists('INPUTYESNO_TEMPLATE_ADMIN', $templates) || empty($templates['INPUTYESNO_TEMPLATE_ADMIN']) )\r
+               {\r
+                       $template = "<input type=\"radio\" id=\"<%yesid%>\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> onclick=\"selectCanLogin(true);\" />\n"\r
+                                 . "<label for=\"<%yesid%>\"><%yesvaltext%></label>\n"\r
+                                 . "<input type=\"radio\" id=\"<%noid%>\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> onclick=\"selectCanLogin(false);\" />\n"\r
+                                 . "<label for=\"<%noid%>\"><%novaltext%></label>\n";\r
+               }\r
+               else\r
+               {\r
+                       $template = $templates['INPUTYESNO_TEMPLATE_ADMIN'];\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if ( array_key_exists('INPUTYESNO_TEMPLATE_NORMAL', $templates) && !empty($templates['INPUTYESNO_TEMPLATE_NORMAL']) )\r
+               {\r
+                       $template = $templates['INPUTYESNO_TEMPLATE_NORMAL'];\r
+               }\r
+               else if ( $showlist && array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO', $templates) && !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO']) )\r
+               {\r
+                       $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO'];\r
+               }\r
+               else\r
+               {\r
+               $template = "<input type=\"radio\" id=\"<%yesid%>\" name=\"<%name%>\" value=\"<%yesval%>\" <%yescheckedval%> />\n"\r
+                         . "<label for=\"<%yesid%>\"><%yesvaltext%></label>\n"\r
+                         . "<input type=\"radio\" id=\"<%noid%>\" name=\"<%name%>\" value=\"<%noval%>\" <%nocheckedval%> <%disabled%> />\n"\r
+                         . "<label for=\"<%noid%>\"><%novaltext%></label>\n";\r
+               }\r
+       }\r
+       \r
+       $id             = preg_replace('#[|]#', '-', $name);\r
+       $id1    = $id . $value1;\r
+       $id2    = $id . $value2;\r
+       $dat = array(\r
+               'name'                  => Entity::hsc($name),\r
+               'yesval'                => Entity::hsc($value1),\r
+               'noval'                 => Entity::hsc($value2),\r
+               'yesid'                 => Entity::hsc($id1),\r
+               'noid'                  => Entity::hsc($id2),\r
+               'yesvaltext'    => $yesval,\r
+               'novaltext'             => $noval,\r
+               'yescheckedval' => ($checkedval == $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',\r
+               'nocheckedval'  => ($checkedval != $value1) ? 'checked="checked" tabindex="' . $tabindex . '"': '',\r
+               'disabled'              => ($isAdmin && $name == 'canlogin') ? ' disabled="disabled"' : '',\r
+       );\r
+       \r
+       return Template::fill($template, $dat);\r
+}\r
+\r
+/**\r
+ * listplug_batchlist()\r
+ * \r
+ * @param      string          $attr   item/member/team/category/comment\r
+ * @param      resource        $query  SQL resorce\r
+ * @param      string          $type   type for showlist()\r
+ * @param      array           $vars   array for variables\r
+ */\r
+function listplug_batchlist($attr, $query, $type, $vars)\r
+{\r
+       global $manager;\r
+       \r
+       /* HEAD */\r
+       $content = "<form method=\"post\" action=\"index.php\">\n";\r
+       \r
+       /* BODY */\r
+       $content .= showlist($query, $type, $vars);\r
+       \r
+       /* FOOT */\r
+       switch ( $attr )\r
+       {\r
+               case 'item':\r
+                       $options = array(\r
+                               'delete'        => _BATCH_ITEM_DELETE,\r
+                               'move'          => _BATCH_ITEM_MOVE\r
+                       );\r
+                       break;\r
+               case 'member':\r
+                       $options = array(\r
+                               'delete'        => _BATCH_MEMBER_DELETE,\r
+                               'setadmin'      => _BATCH_MEMBER_SET_ADM,\r
+                               'unsetadmin' => _BATCH_MEMBER_UNSET_ADM\r
+                       );\r
+                       break;\r
+               case 'team':\r
+                       $options = array(\r
+                               'delete'        => _BATCH_TEAM_DELETE,\r
+                               'setadmin'      => _BATCH_TEAM_SET_ADM,\r
+                               'unsetadmin' => _BATCH_TEAM_UNSET_ADM,\r
+                       );\r
+                       break;\r
+               case 'category':\r
+                       $options = array(\r
+                               'delete'        => _BATCH_CAT_DELETE,\r
+                               'move'          => _BATCH_CAT_MOVE,\r
+                       );\r
+                       break;\r
+               case 'comment':\r
+                       $options = array(\r
+                               'delete'        => _BATCH_COMMENT_DELETE,\r
+                       );\r
+                       break;\r
+               default:\r
+                       $options = array();\r
+                       break;\r
+       }\r
+       \r
+       $content .= "<p class=\"batchoperations\">\n"\r
+                  . _BATCH_WITH_SEL\r
+                  . "<select name=\"batchaction\">\n";\r
+       \r
+       foreach ( $options as $option => $label )\r
+       {\r
+               $content .= "<option value=\"{$option}\">{$label}</option>\n";\r
+       }\r
+       $content .= "</select>\n";\r
+       \r
+       if ( $attr == 'team' )\r
+       {\r
+               $content .= '<input type="hidden" name="blogid" value="' . intRequestVar('blogid') . '" />';\r
+       }\r
+       else if ( $attr == 'comment' )\r
+       {\r
+               $content .= '<input type="hidden" name="itemid" value="' . intRequestVar('itemid') . '" />';\r
+       }\r
+       \r
+       $content .= '<input type="submit" value="' . _BATCH_EXEC . '" />'\r
+                  . "("\r
+                  . "<a href=\"\" onclick=\"if( event &amp;&amp; event.preventDefault ) event.preventDefault(); return batchSelectAll(1); \">" . _BATCH_SELECTALL . "</a>"\r
+                  . " - "\r
+                  . "<a href=\"\" onclick=\"if( event &amp;&amp; event.preventDefault ) event.preventDefault(); return batchSelectAll(0); \">" . _BATCH_DESELECTALL . "</a>"\r
+                  . ")\n"\r
+                  . "<input type=\"hidden\" name=\"action\" value=\"batch{$attr}\" />\n"\r
+                  . '<input type="hidden" name="ticket" value="' . Entity::hsc($manager->getNewTicket()) . '" />' . "\n"\r
+                  . "</p>\n"\r
+                  . "</form>\n";\r
+       \r
+       return $content;\r
+}\r
+\r
+/**\r
+ * listplug_navlist()\r
+ * \r
+ * @param      string          $attr   item/member/team/category/comment\r
+ * @param      resource        $query  SQL resorce\r
+ * @param      string          $type   type for showlist()\r
+ * @param      array           $vars   array for variables\r
+ */\r
+function listplug_navlist($attribute, $query, $type, $vars)\r
+{\r
+       global $CONF;\r
+       \r
+       $prev = $vars['start'] - $vars['amount'];\r
+       if ( $prev < $vars['minamount'] )\r
+       {\r
+               $prev = $vars['minamount'];\r
+       }\r
+       \r
+       $next = $vars['start'] + $vars['amount'];\r
+       \r
+       $navi = "\n";\r
+       $navi .= "<table frame=\"box\" rules=\"all\" sumamry=\"navigation actions\" class=\"navigation\">\n"\r
+              . "<tr>\n";\r
+       $navi .= "<td>\n"\r
+              . "<form method=\"post\" action=\"{$CONF['AdminURL']}\">\n"\r
+              . "<input type=\"hidden\" name=\"start\" value=\"{$prev}\" />\n"\r
+              . "<button type=\"submit\" name=\"action\" value=\"{$vars['action']}\">&lt; &lt; " . _LISTS_PREV . "</button>\n"\r
+              . "<input type=\"hidden\" name=\"blogid\" value=\"{$vars['blogid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"itemid\" value=\"{$vars['itemid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"search\" value=\"{$vars['search']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"amount\" value=\"{$vars['amount']}\" />\n"\r
+              . "</form>\n"\r
+              . "</td>\n";\r
+       $navi .= "<td>\n"\r
+              . "<form method=\"post\" action=\"{$CONF['AdminURL']}\">\n"\r
+              . "<input type=\"text\" name=\"amount\" size=\"3\" value=\"{$vars['amount']}\" />\n"\r
+              . _LISTS_PERPAGE\r
+              . "<input type=\"hidden\" name=\"start\" value=\"0\" />\n"\r
+              . "<button type=\"submit\" name=\"action\" value=\"{$vars['action']}\">&gt; " . _LISTS_CHANGE . "</button>\n"\r
+              . "<input type=\"hidden\" name=\"blogid\" value=\"{$vars['blogid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"itemid\" value=\"{$vars['itemid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"search\" value=\"{$vars['search']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"amount\" value=\"{$vars['amount']}\" />\n"\r
+              . "</form>\n"\r
+              . "</td>\n";\r
+       $navi .= "<td>\n"\r
+              . "<form method=\"post\" action=\"{$CONF['AdminURL']}\">\n"\r
+              . "<input type=\"text\" name=\"search\" value=\"{$vars['search']}\" size=\"7\" />\n"\r
+              . "<input type=\"hidden\" name=\"start\" value=\"0\" />\n"\r
+              . "<button type=\"submit\" name=\"action\" value=\"{$vars['action']}\">&gt; " . _LISTS_SEARCH . "</button>\n"\r
+              . "<input type=\"hidden\" name=\"blogid\" value=\"{$vars['blogid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"itemid\" value=\"{$vars['itemid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"search\" value=\"{$vars['search']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"amount\" value=\"{$vars['amount']}\" />\n"\r
+              . "</form>\n"\r
+              . "</td>\n";\r
+       $navi .= "<td>\n"\r
+              . "<form method=\"post\" action=\"{$CONF['AdminURL']}\">\n"\r
+              . "<input type=\"hidden\" name=\"start\" value=\"{$next}\" />\n"\r
+              . "<button type=\"submit\" name=\"action\" value=\"{$vars['action']}\">" . _LISTS_NEXT . "&gt; &gt; </button>\n"\r
+              . "<input type=\"hidden\" name=\"blogid\" value=\"{$vars['blogid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"itemid\" value=\"{$vars['itemid']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"search\" value=\"{$vars['search']}\" />\n"\r
+              . "<input type=\"hidden\" name=\"amount\" value=\"{$vars['amount']}\" />\n"\r
+              . "</form>\n"\r
+              . "</td>\n";\r
+       $navi .= "</tr>\n"\r
+              . "</table>\n";\r
+       \r
+       /* HEAD */\r
+       $template = $navi;\r
+       \r
+       /* BODY */\r
+       $template .= listplug_batchlist($attribute, $query, $type, $vars);\r
+       \r
+       /* FOOT */\r
+       $template .= $navi;\r
+       \r
+       return $template;\r
+}\r