From 6a3449bb310e293b77506a9987e2677b1d94c20d Mon Sep 17 00:00:00 2001 From: sakamocchi Date: Sat, 7 Apr 2012 08:00:03 +0900 Subject: [PATCH] =?utf8?q?skinnableADMIN=E3=82=AF=E3=83=A9=E3=82=B9?= =?utf8?q?=E3=81=8B=E3=82=89=E5=85=A8=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?utf8?q?=E3=81=AE=E7=A7=BB=E6=A4=8D=E3=82=92=E7=B5=82=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 今後、ActionsクラスとAdminActionsクラスに分離するなどの検討をする必要あり。 --- nucleus/libs/ACTIONS.php | 1062 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1062 insertions(+) diff --git a/nucleus/libs/ACTIONS.php b/nucleus/libs/ACTIONS.php index f4ea58f..a4c15be 100644 --- a/nucleus/libs/ACTIONS.php +++ b/nucleus/libs/ACTIONS.php @@ -4847,4 +4847,1066 @@ class Actions extends BaseActions echo intRequestVar('itemid'); return; } + + /** + * Actions::parse_newestcompare() + * Parse skinvar newestcompare + * + * @param void + * @return void + */ + public function parse_newestcompare() + { + global $nucleus; + $newestVersion = getLatestVersion(); + $newestCompare = str_replace('/', '.', $newestVersion); + $currentVersion = str_replace(array('/', 'v'), array('.', ''), $nucleus['version']); + if ( $newestVersion && version_compare($newestCompare, $currentVersion, '>') ) + { + echo '
'; + echo _ADMIN_SYSTEMOVERVIEW_LATESTVERSION_TEXT . $newestVersion . ''; + } + return; + } + + /** + * Actions::parse_newmemberselect() + * Parse skinvar newmemberselect + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_newmemberselect($templateName = '') + { + $blogid = intRequestVar('blogid'); + + $query = "SELECT tmember FROM %s WHERE tblog=%d;"; + $query = sprintf($query, sql_table('team'), (integer) $blogid); + $res = sql_query($query); + + $tmem = array(); + while ( $tmember = sql_fetch_object($res) ) + { + $tmem[] = intval($tmember->tmember); + } + + $query = "SELECT mname as text, mnumber as value FROM %s WHERE mnumber NOT IN (%s);"; + $query = sprintf($query, sql_table('member'), implode(', ', $tmem)); + + $template['name'] = 'memberid'; + $template['tabindex'] = 10000; + skinableShowlist($query, 'select', $template, $templateName); + return; + } + + /** + * Actions::parse_newpluginlist() + * Parse skinvar newpluginlist + * + * @param void + * @return void + */ + public function parse_newpluginlist() + { + $candidates = $this->newPlugCandidates; + foreach ( $candidates as $name ) + { + echo '\n"; + } + return; + } + + /** + * Actions::parse_outputspecialdirs() + * Parse skinvar outputspecialdirs + * + * @param string $type type of setting for directory + * @return void + */ + public function parse_outputspecialdirs($type) + { + switch ( $type ) + { + case 'nucleusdir': + global $DIR_NUCLEUS; + echo Entity::hsc($DIR_NUCLEUS); + break; + case 'mediadir': + global $DIR_MEDIA; + echo Entity::hsc($DIR_MEDIA); + break; + } + return; + } + + /** + * Actions::parse_passrequestvars() + * Parse skinvar passrequestvars + * + * @param void + * @return void + */ + public function parse_passrequestvars() + { + $oldaction = postVar('oldaction'); + if ( ($oldaction != 'logout') + && ($oldaction != 'login') + && $this->objAdmin->passvar + && !postVar('customaction') ) + { + passRequestVars(); + } + return; + } + + /** + * Actions::parse_pluginextras() + * Parse skinvar pluginextras + * + * @param string $type type of plugin context + * @return void + */ + function parse_pluginextras($type = 'global') + { + global $manager; + switch ( $type ) + { + case 'member': + $id = intRequestVar('memberid'); + $mem = MEMBER::createFromID($id); + $manager->notify( + 'MemberSettingsFormExtras', + array( + 'member' => &$mem + ) + ); + break; + case 'blog': + $id = intRequestVar('blogid'); + $blg = $manager->getBlog($id); + $manager->notify( + 'BlogSettingsFormExtras', + array( + 'member' => &$blg + ) + ); + break; + default: + $manager->notify( + 'GeneralSettingsFormExtras', + array( + ) + ); + break; + } + return; + } + + /** + * Actions::parse_pluginhelp() + * Parse skinvar pluginhelp + * + * @param void + * @return void + */ + public function parse_pluginhelp() + { + global $manager, $DIR_PLUGINS; + $plugid = intGetVar('plugid'); + $plugName = getPluginNameFromPid($plugid); + $plug =& $manager->getPlugin($plugName); + + if ( $plug->supportsFeature('HelpPage') > 0 ) + { + $helpfile = $DIR_PLUGINS . $plug->getShortName() . '/help.'; + if ( @file_exists($helpfile . 'php') ) + { + @include($helpfile . 'php'); + return; + } + elseif ( @file_exists($helpfile . 'html') ) + { + @include($helpfile . 'html'); + return; + } + } + echo '

' . _ERROR . ': ' . _ERROR_PLUGNOHELPFILE . "

\n"; + echo '

(' . _BACK . ")

\n"; + return; + } + + /** + * Actions::parse_pluginlistlist() + * Parse skinvar pluginlistlist + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_pluginlistlist($templateName = '') + { + $query = "SELECT * FROM %s ORDER BY porder ASC;"; + $query = sprintf($query, sql_table('plugin')); + $template['content'] = 'pluginlist'; + $template['tabindex'] = 10; + skinableShowlist($query, 'table', $template, $templateName); + return; + } + + /** + * Actions::parse_pluginoptions() + * Parse skinvar pluginoptions + * + * @param string $type type of plugin option + * @return void + */ + public function parse_pluginoptions($type = 'global') + { + switch ( $type ) + { + case 'member': + $id = intRequestVar('memberid'); + break; + case 'blog': + $id = intRequestVar('blogid'); + break; + case 'category': + $id = intRequestVar('catid'); + break; + } + $this->objAdmin->_insertPluginOptions($type, $id); + return; + } + + /** + * Actions::parse_qmenuaddselect() + * Parse skinvar qmanuaddselect + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_qmenuaddselect($templateName = '') + { + global $member; + $showAll = requestVar('showall'); + if ( $member->isAdmin() && ($showAll == 'yes') ) + { + // Super-Admins have access to all blogs! (no add item support though) + $query = 'SELECT bnumber as value, bname as text' + . ' FROM ' . sql_table('blog') + . ' ORDER BY bname'; + } + else + { + $query = 'SELECT bnumber as value, bname as text' + . ' FROM ' . sql_table('blog') . ', ' . sql_table('team') + . ' WHERE tblog=bnumber and tmember=' . $member->getID() + . ' ORDER BY bname'; + } + $template['name'] = 'blogid'; + $template['tabindex'] = 15000; + $template['extra'] = _QMENU_ADD_SELECT; + $template['selected'] = -1; + $template['shorten'] = 10; + $template['shortenel'] = ''; + $template['javascript'] = 'onchange="return form.submit()"'; + skinableShowlist($query, 'select', $template, $templateName); + return; + } + + /** + * Actions::parse_quickmenu() + * Parse skinvar quickmenu + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_quickmenu($templateName = '') + { + global $manager; + $templates = array(); + $template = array(); + if ( !empty($templateName) ) + { + $templates = skinableTEMPLATE::read($templateName); + } + $pluginExtras = array(); + $manager->notify( + 'QuickMenu', + array( + 'options' => &$pluginExtras + ) + ); + if ( count($pluginExtras) > 0 ) + { + if ( array_key_exists('PLUGIN_QUICKMENU_TITLE', $templates) || !empty($templates['PLUGIN_QUICKMENU_TITLE']) ) + { + $template['title'] = $templates['PLUGIN_QUICKMENU_TITLE']; + } + else + { + $template['title'] = '

<%text(_QMENU_PLUGINS)%>

'; + } + $handler = new skinableACTIONS($this->skintype, $template, $this->objAdmin); + $parser = new PARSER(skinableACTIONS::getDefinedActions(), $handler); + $parser->parse($template['title']); + + if ( array_key_exists('PLUGIN_QUICKMENU_HEAD', $templates) || !empty($templates['PLUGIN_QUICKMENU_HEAD']) ) + { + $template['head'] = $templates['PLUGIN_QUICKMENU_HEAD']; + } + else + { + $template['head'] = ''; + } + echo $template['foot']; + } + return; + } + + /** + * Actions::parse_requestblogid() + * Parse skinvar requestblogid + * + * @param void + * @return void + */ + public function parse_requestblogid() + { + echo intRequestVar('blogid'); + return; + } + + /** + * Actions::parse_requestiprange() + * Parse skinvar requestiprange + * + * @param void + * @return void + */ + public function parse_requestiprange() + { + if ( requestVar('iprange') ) + { + echo Entity::hsc(requestVar('iprange')); + } + elseif ( requestVar('ip') ) + { + echo Entity::hsc(requestVar('ip')); + } + return; + } + + /** + * Actions::parse_selectlocaladminskinfiles() + * Parse skinvar selectlocaladminskinfiles + * + * @param void + * @return void + */ + public function parse_selectlocaladminskinfiles() + { + global $DIR_ADMINSKINS, $manager; + $candidates = skinableSKINIMPORT::searchForCandidates($DIR_ADMINSKINS); + foreach ( $candidates as $skinname => $skinfile ) + { + $html = Entit::hsc($skinfile); + echo '\n"; + } + return; + } + + /** + * Actions::parse_selectlocalskinfiles() + * Parse skinvar selectlocalskinfiles + * + * @param void + * @return void + */ + function parse_selectlocalskinfiles() + { + global $DIR_SKINS; + $candidates = SKINIMPORT::searchForCandidates($DIR_SKINS); + foreach ( $candidates as $skinname => $skinfile ) + { + $html = ENTITY::hsc($skinfile); + echo '\n"; + } + return; + } + + /** + * Actions::parse_skineditallowedlist() + * Parse skinvar skineditallowedlist + * + * @param string $type type of skin + * @param string $templateName name of template + * @return void + */ + public function parse_skineditallowedlist($type, $templateName = '') + { + switch ( $type ) + { + case 'blog': + $query = "SELECT bshortname, bname FROM %s"; + $show = array( + 'content' => 'shortblognames' + ); + $query = sprintf($query, sql_table('blog')); + skinableShowlist($query, 'table', $show, $templateName); + break; + case 'template': + $query = "SELECT tdname as name, tddesc as description FROM %s"; + $show = array( + 'content' => 'shortnames' + ); + $query = sprintf($query, sql_table('template_desc')); + skinableShowlist($query, 'table', $show, $templateName); + break; + } + return; + } + + /** + * Actions::parse_skinfile() + * Inserts an url relative to the skindir (useful when doing import/export) + * + * e.g. + * + * @param string $filename file name for skin + * @return void + */ + public function parse_skinfile($filename) + { + $base = NP_SkinableAdmin::getAdminSkinURL(); + $pref = PARSER::getProperty('IncludePrefix'); + echo $base . $pref . $filename; + return; + } + + /** + * Actions::parse_skinielist() + * Parse skinvar skinielist + * + * @param string $type type of skin + * @param string $templateName name of template to use + * @return void + */ + public function parse_skinielist($type, $templateName = '') + { + $templates = array(); + if ( $templateName ) + { + $templates = skinableTEMPLATE::read($templateName); + } + if ( array_key_exists('SKINIE_EXPORT_LIST', $templates) && !empty($templates['SKINIE_EXPORT_LIST']) ) + { + $template = $templates['SKINIE_EXPORT_LIST']; + } + else + { + $template = '' . "\n" + . "<%expdesc%>\n" + . "\n"; + } + switch ( $type ) + { + case 'skin': + $res = sql_query('SELECT * FROM ' . sql_table('skin_desc')); + while ( $skinObj = sql_fetch_object($res) ) + { + $data = array( + 'typeid' => 'skin[' . $skinObj->sdnumber . ']', + 'expid' => 'skinexp' . $skinObj->sdnumber, + 'expname' => ENTITY::hsc($skinObj->sdname, ENT_QUOTES), + 'expdesc' => ENTITY::hsc($skinObj->sddesc, ENT_QUOTES), + ); + echo TEMPLATE::fill($template, $data); + } + break; + case 'template': + $res = sql_query('SELECT * FROM '.sql_table('template_desc')); + while ($templateObj = sql_fetch_object($res)) { + $data = array( + 'typeid' => 'template[' . $templateObj->tdnumber . ']', + 'expid' => 'templateexp' . $templateObj->tdnumber, + 'expname' => ENTITY::hsc($templateObj->tdname, ENT_QUOTES), + 'expdesc' => ENTITY::hsc($templateObj->tddesc, ENT_QUOTES), + ); + echo TEMPLATE::fill($template, $data); + } + break; + } + return; + } + + /** + * Actions::parse_skinoverview() + * Parse skinvar skinoverview + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_skinoverview($templateName = '') + { + $query = "SELECT * FROM %s ORDER BY sdname"; + $query = sprintf($query, sql_table('skin_desc')); + + $template['content'] = 'skinlist'; + $template['tabindex'] = 10; + + skinableShowlist($query, 'table', $template, $templateName); + return; + } + + /** + * Actions::parse_skintypehelp() + * Check editing skintypehelp + * + * @param void + * @return void + */ + public function parse_skintypehelp() + { + $nowSkinType = strtolower(trim(requestVar('type'))); + $regularType = array( + 'index', + 'item', + 'archivelist', + 'archive', + 'search', + 'error', + 'member', + 'imagepopup' + ); + + if ( in_array($nowSkinType, $regularType) ) + { + help('skinpart' . $nowSkinType); + } + else + { + help('skinpartspecial'); + } + return; + } + + /** + * Actions::parse_specialskinlist() + * Parse skinvar specialskinlist + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_specialskinlist($templateName = '') + { + $templates = array(); + if ( $templateName ) + { + $templates = skinableTEMPLATE::read($templateName); + } + $nType = array( + 'index', + 'item', + 'error', + 'search', + 'archive', + 'archivelist', + 'imagepopup', + 'member' + ); + $skinid = intRequestVar('skinid'); + $query = "SELECT stype FROM %s WHERE stype NOT IN ('%s') AND sdesc = %d;"; + $query = sprintf($query, sql_table('skin'), implode("', '", $nType), $skinid); + + $res = sql_query($query); + if ( $res && sql_num_rows($res) > 0 ) + { + $data = array(); + if ( array_key_exists('SPECIALSKINLIST_HEAD', $templates) && !empty($templates['SPECIALSKINLIST_HEAD']) ) + { + $template['head'] = $templates['SPECIALSKINLIST_HEAD']; + } + else + { + $template['head'] = "\n"; + } + echo TEMPLATE::fill($template['foot'], $data); + return; + } + } + + /** + * Actions::parse_sprinttext() + * Parse sprinttext + * + * @param string $which + * @param string $val + * @return void + */ + public function parse_sprinttext($which, $val) + { + if ( !defined($which) ) + { + $base = $which; + } + else + { + $base = constant($which); + } + + if ( preg_match('#[^<|%].*[^%|>]#', $val, $matchies) ) + { + if ( !preg_match('#[(].*[^)]#', $matchies[0], $args) ) + { + $met = 'parse_' . $matchies[0]; + } + else + { + $arg = trim($args[0], '()'); + $met = 'parse_' . substr($matchies[0], 0, strpos($matchies[0], '(')); + } + + if ( method_exists($this, $met) ) + { + $value = call_user_func(array(&$this, $met), $arg); + } + } + + if ( !isset($value) || empty($value) ) + { + $value = $val; + } + echo sprintf($base, $value); + return; + } + + /** + * Actions::parse_systemsettings() + * Parse skinvar systemsettings + * + * @param string $type type of settings for system + * @param string $templateName name of template to use + * @return void + */ + public function parse_systemsettings($type = 'phpinfo', $templateName = '') + { + global $member, $CONF, $nucleus; + + $member->isAdmin() or $this->objAdmin->disallow(); + + $enable = _ADMIN_SYSTEMOVERVIEW_ENABLE; + $disable = _ADMIN_SYSTEMOVERVIEW_DISABLE; + + switch ( $type ) + { + case 'phpversion': + echo phpversion(); + break; + case 'sqlserverinfo': + echo sql_get_server_info(); + break; + case 'sqlclientinfo': + echo sql_get_client_info(); + break; + case 'magicquotesgpc': + echo ini_get('magic_quotes_gpc') ? 'On' : 'Off'; + break; + case 'magicquotesruntime': + echo ini_get('magic_quotes_runtime') ? 'On' : 'Off'; + break; + case 'registerglobals': + echo ini_get('register_globals') ? 'On' : 'Off'; + break; + case 'gdinfo': + $templates = array(); + if ( $templateName ) + { + $templates = skinableTEMPLATE::read($templateName); + } + if ( array_key_exists('SYSTEMINFO_GDSETTINGS', $templates) && !empty($templates['SYSTEMINFO_GDSETTINGS']) ) + { + $template = $templates['SYSTEMINFO_GDSETTINGS']; + } + else + { + $template = "\n\t\t" . '' . "<%key%><%value%>\n\n"; + } + + $gdinfo = gd_info(); + + foreach ( $gdinfo as $key => $value ) + { + if ( is_bool($value) ) + { + $value = $value ? $enable : $disable; + } + else + { + $value = ENTITY::hsc($value, ENT_QUOTES); + } + $data = array( + 'key' => $key, + 'value' => $value, + ); + echo TEMPLATE::fill($template, $data); + } + break; + case 'modrewrite': + ob_start(); + phpinfo(INFO_MODULES); + $im = ob_get_contents(); + ob_end_clean(); + echo (strstr($im, 'mod_rewrite') != '') ? $enable : $disable; + break; + case 'nucleusversion': + echo getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')'; + break; + case 'nucleuspatchlevel': + echo getNucleusPatchLevel(); + break; + case 'confself': + echo $CONF['Self']; + break; + case 'confitemurl': + echo $CONF['ItemURL']; + break; + case 'alertonheaderssent': + echo $CONF['alertOnHeadersSent'] ? $enable : $disable; + break; + case 'nucleuscodename': + if ( $nucleus['codename'] != '' ) + { + echo ' "' . $nucleus['codename'] . '"'; + } + break; + case 'versioncheckurl': + echo sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel()); + break; + } + return; + } + + /** + * Actions::parse_templateoverview() + * Parse skinvar templateoverview + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_templateoverview($templateName = '') + { + $query = "SELECT * FROM %s ORDER BY tdname"; + $query = sprintf($query, sql_table('template_desc')); + $template['content'] = 'templatelist'; + $template['tabindex'] = 10; + skinableShowlist($query, 'table', $template, $templateName); + return; + } + + /** + * Actions::parse_versioncheckurl() + * Parse skinvar versioncheckurl + * + * @param void + * @return void + */ + public function parse_versioncheckurl() + { + echo sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel()); + return; + } + + /** + * Actions::parse_yrbloglist() + * Parse skinvar yrbloglist + * + * @param string $templateName name of template to use + * @return void + */ + public function parse_yrbloglist($templateName = '') + { + global $member; + $showAll = requestVar('showall'); + + if ( $member->isAdmin() && ($showAll == 'yes') ) + { + // Super-Admins have access to all blogs! (no add item support though) + $query = "SELECT bnumber, bname, 1 as tadmin, burl, bshortname" + . " FROM %s" + . " ORDER BY bnumber"; + $query = sprintf($query, sql_table('blog')); + } + else + { + $query = "SELECT bnumber, bname, tadmin, burl, bshortname" + . " FROM %s,%s" + . " WHERE tblog=bnumber and tmember=%d" + . " ORDER BY bnumber"; + $query = sprintf($query, sql_table('blog'), sql_table('team'), (integer) $member->getID()); + } + + $template['content'] = 'bloglist'; + $template['superadmin'] = $member->isAdmin(); + + $amount = skinableShowlist($query, 'table', $template, $templateName); + + if ( ($showAll != 'yes') && ($member->isAdmin()) ) + { + $query = 'SELECT COUNT(*) as result FROM ' . sql_table('blog'); + + $total = quickQuery($query); + if ( $total > $amount ) + { + echo '

' . _OVERVIEW_SHOWALL . '

'; + } + } + + if ( $amount == 0 ) + { + echo _OVERVIEW_NOBLOGS; + } + elseif( $amount != 0 ) + { + echo '

' . _OVERVIEW_YRDRAFTS . '

'; + + $query = "SELECT ititle, inumber, bshortname" + . " FROM %s,%s" + . ' WHERE iauthor=%d AND iblog=bnumber AND idraft=1'; + $query = sprintf($query. sql_table('item'), sql_table('blog'), (integer) $member->getID()); + + $template['content'] = 'draftlist'; + + $amountdrafts = skinableShowlist($query, 'table', $template, $templateName); + if ( $amountdrafts == 0 ) + { + echo _OVERVIEW_NODRAFTS; + } + } + return; + } + + /** + * Actions::customHelp() + * shows a link to custom help file + * + * @param integer $id + * @param string $tplName + * @param string $url + * @param string $iconURL + * @param string $alt + * @param string $title + * @param $onclick + * + */ + private function customHelp($id, $tplName = '', $url = '', $iconURL = '', $alt = '', $title = '', $onclick = '') + { + echo self::customHelpHtml($id, $tplName, $url, $iconURL, $alt, $title, $onclick); + } + + /** + * Actions::customHelpHtml() + * + * @param integer $id + * @param string $tplName + * @param string $url + * @param string $iconURL + * @param string $alt + * @param string $title + * @param string $onclick + * @return string anchor element with help uri + */ + static public function customHelpHtml($id, $tplName = '', $url = '', $iconURL = '', $alt = '', $title = '', $onclick = '') + { + $templates = array(); + if ( $tplName ) + { + $templates = skinableTEMPLATE::read($tplName); + } + if ( array_key_exists('ADMIN_CUSTOMHELPLINK_ICON', $templates) && !empty($templates['ADMIN_CUSTOMHELPLINK_ICON']) ) + { + $template = $templates['ADMIN_CUSTOMHELPLINK_ICON']; + } + else + { + $template = '<%height%>alt="<%alt%>" title="<%title%>" />'; + } + + if ( empty($iconURL) ) + { + global $CONF; + $iconURL = $CONF['AdminURL'] . 'documentation/icon-help.gif'; + } + if ( function_exists('getimagesize') ) + { + $size = getimagesize($iconURL); + $width = 'width="' . $size[0] . '" '; + $height = 'height="' . $size[1] . '" '; + } + $data = array( + 'iconurl' => $iconURL, + 'width' => $width, + 'height' => $height, + 'alt' => (isset($alt) && !empty($alt)) ? $alt : _HELP_TT, + 'title' => (isset($title) && !empty($title)) ? $title : _HELP_TT, + ); + $icon = TEMPLATE::fill($template, $data); + $help = self::customHelplink($id, $tplName, $url, $title, $onclick); + return $help . $icon; + } + + /** + * Actions::input_yesno + * + * @param $name + * @param $checkedval + * @param $tabindex + * @param $value1 + * @param $value2 + * @param $yesval + * @param $noval + * @param $isAdmin + * @param $templateName + * @param $showlist + */ + static function input_yesno($name, + $checkedval, + $tabindex = 0, + $value1 = 1, + $value2 = 0, + $yesval = _YES, + $noval = _NO, + $isAdmin = 0, + $templateName = '', + $showlist = false) + { + $templates = array(); + if ( $templateName ) + { + $templates = skinableTEMPLATE::read($templateName); + } + + if ( $name == 'admin' ) + { + if ( array_key_exists('INPUTYESNO_TEMPLATE_ADMIN', $templates) && !empty($templates['INPUTYESNO_TEMPLATE_ADMIN']) ) + { + $template = $templates['INPUTYESNO_TEMPLATE_ADMIN']; + } + else + { + $template = ' id="<%yesid%>" />' . "\n" + . '' . "\n" + . ' id="<%noid%>"<%disabled%> />' . "\n" + . '' . "\n"; + } + } + else + { + if ( array_key_exists('INPUTYESNO_TEMPLATE_NORMAL', $templates) && !empty($templates['INPUTYESNO_TEMPLATE_NORMAL']) ) + { + $template = $templates['INPUTYESNO_TEMPLATE_NORMAL']; + } + if ( $showlist ) + { + if ( array_key_exists('SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO', $templates) && !empty($templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO']) ) + { + $template = $templates['SHOWLIST_LISTPLUG_TABLE_PLGOPT_OYESNO']; + } + } + if ( !isset($template) ) + { + $template = ' id="<%yesid%>" />' . "\n" + . '' . "\n" + . ' id="<%noid%>"<%disabled%> />' . "\n" + . '' . "\n"; + } + } + + //echo $template; + $id = ENTITY::hsc($name); + $id = str_replace('[', '-', $id); + $id = str_replace(']', '-', $id); + $id1 = $id . ENTITY::hsc($value1); + $id2 = $id . ENTITY::hsc($value2); + $dat = array( + 'name' => ENTITY::hsc($name), + 'yesval' => ENTITY::hsc($value1), + 'noval' => ENTITY::hsc($value2), + 'yesid' => $id1, + 'noid' => $id2, + 'yesvaltext' => $yesval, + 'novaltext' => $noval, + 'yescheckedval' => ($checkedval == $value1) ? ' checked="checked" tabindex="' . $tabindex . '"': '', + 'nocheckedval' => ($checkedval != $value1) ? ' checked="checked" tabindex="' . $tabindex . '"': '', + 'disabled' => ($isAdmin && $name == 'canlogin') ? ' disabled="disabled"' : '', + ); + + if ( $showlist ) + { + return skinableTEMPLATE::fill($template, $dat); + } + else + { + echo TEMPLATE::fill($template, $dat); + } + return; + } } -- 2.11.0