'adminskinremovetype' => _ADM_SKPRT_ADMINSKINREMOVETYPE,
'admintemplatedelete' => _ADM_SKPRT_ADMINTEMPLATEDELETE,
'admintemplateedit' => _ADM_SKPRT_ADMINTEMPLATEEDIT,
- 'admintemplateoverview' => _ADM_SKPRT_ADMINTEMPLATEOVERVIEW,
+ 'admntemplateoverview' => _ADM_SKPRT_ADMINTEMPLATEOVERVIEW,
'backupoverview' => _ADM_SKPRT_BACKUPOVERVIEW,
'backuprestore' => _ADM_SKPRT_BACKUPRESTORE,
'banlist' => _ADM_SKPRT_BANLIST,
if ( !array_key_exists('ADMIN_BATCHLIST', $templates) || empty($templates['ADMIN_BATCHLIST']) )
{
- $template = '<li><%text(_BATCH_EXECUTING)%>'
- . '<b><%adminbatchaction%></b>'
- . '<%batchlisttype%>'
- . '<b><%batchid%></b>...'
+ $template = '<li><%text(_BATCH_EXECUTING)%> '
+ . '<b><%adminbatchaction%></b> '
+ . '<%batchlisttype%> '
+ . '<b><%batchid%></b>... '
. '<b><%batchlistmsg%></b>'
. '</li>' . "\n";
}
}
else
{
- DB::execute("UPDATE {$setadminsql} {$selectedid};");
+ DB::execute("UPDATE {$unsetupsql} {$selectedid};");
}
break;
default:
$handler = new AdminActions('template');
$parser = new Parser($handler);
+ $output = Template::fill($template, $data);
ob_start();
- $parser->parse($template);
- $template = ob_get_contents();
+ $parser->parse($output);
+ $output = ob_get_contents();
ob_end_clean();
- echo Template::fill($template, $data);
+ echo "{$output}<br />";
}
return;
}
* @param void
* @return void
*/
- public function parse_adminskinselectoptions()
+ public function parse_adminskinselectoptions($templateName = '')
{
global $CONF;
$query = "SELECT sdname as text, sdnumber as value FROM %s WHERE sdname LIKE 'admin/%%';";
$template['name'] = 'adminskin';
$template['selected'] = $CONF['AdminSkin'];
$template['tabindex'] = 110;
- Showlist($query, 'select', $template, '');
+ Showlist($query, 'select', $template, $templateName);
return;
}
*/
public function parse_editpluginfo($type)
{
+ global $manager;
+
$pid = intRequestVar('plugid');
switch ( $type )
{
echo $pid;
break;
case 'name':
- echo Entity::hsc(getPluginNameFromPid($pid));
+ echo Entity::hsc($manager->getPluginNameFromPid($pid));
break;
}
return;
return $pid;
break;
case 'name':
- return Entity::hsc(getPluginNameFromPid($pid));
+ return Entity::hsc($manager->getPluginNameFromPid($pid));
break;
}
return;
public function parse_helpplugname()
{
$plugid = intGetVar('plugid');
- Entity::hsc(getPluginNameFromPid($plugid));
+ Entity::hsc($manager->getPluginNameFromPid($plugid));
return;
}
$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;
+ $template = array(
+ 'name' => 'memberid',
+ 'tabindex' => 10000,
+ 'selected' => 0
+ );
Showlist($query, 'select', $template, $templateName);
return;
}
global $manager, $DIR_PLUGINS;
$plugid = intGetVar('plugid');
- $plugName = getPluginNameFromPid($plugid);
+ $plugName = $manager->getPluginNameFromPid($plugid);
$plug =& $manager->getPlugin($plugName);
if ( $plug->supportsFeature('HelpPage') > 0 )
{
global $DIR_PLUGINS;
- $candidates = array();
+ $query = "SELECT * FROM %s;";
+ $query = sprintf($query, sql_table('plugin'));
+ $res = DB::getResult($query);
+
+ $installed = array();
+ foreach( $res as $row )
+ {
+ $installed[] = $row['pfile'];
+ }
+
$files = scandir($DIR_PLUGINS);
+ $candidates = array();
foreach ( $files as $file )
{
- if ( preg_match("#^NP_(.*)\.php$#", $file, $matches) )
+ if ( preg_match("#^(NP_.*)\.php$#", $file, $matches) )
{
- $name = $matches[1];
- $query = "SELECT * FROM %s WHERE pfile=%s;";
- $query = sprintf($query, sql_table('plugin'), DB::quoteValue("{NP_{$name}"));
- $res = DB::getResult($query);
-
- if ( $res->rowCount() == 0 )
+ if ( !in_array($matches[1], $installed) )
{
- $candidates[] = $name;
+ $candidates[] = $matches[1];
}
}
- continue;
}
$this->newPlugCandidates = $candidates;
return (count($candidates) > 0);