mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
More work on user administrators - plugin icons.
This commit is contained in:
parent
1d20338f63
commit
7b5cfe8afa
@ -372,7 +372,7 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
|
||||
{
|
||||
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off");
|
||||
$plugin_icon = $eplug_icon_small ? "<img class='icon S16' src='".e_PLUGIN.$eplug_icon_small."' alt='' />" : E_16_PLUGIN;
|
||||
$plugin_icon_32 = $eplug_icon ? "<img class='icon S32' src='".e_PLUGIN.$eplug_icon."' alt='' />" : E_32_PLUGIN;
|
||||
$plugin_icon_32 = $eplug_icon ? "<img class='icon S32' src='".e_PLUGIN.$eplug_icon."' alt='' />" : E_32_PLUGIN;
|
||||
$plugin_array['p-'.$plugin_path] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plug_id[$plugin_path], 'icon' => $plugin_icon, 'icon_32' => $plugin_icon_32);
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,22 @@ if (isset ($_POST['adduser']))
|
||||
$QUICKADDUSER_TEMPLATE = USRLAN_185.USRLAN_186;
|
||||
}
|
||||
|
||||
$e_message = str_replace(array('{SITEURL}','{LOGIN}','{USERNAME}','{PASSWORD}'),array(SITEURL,$user_data['user_name'],$user_data['user_login'],$savePassword),$QUICKADDUSER_TEMPLATE);
|
||||
$var_search = array(
|
||||
'{SITEURL}',
|
||||
'{LOGIN}',
|
||||
'{USERNAME}',
|
||||
'{PASSWORD}',
|
||||
'{EMAIL}'
|
||||
);
|
||||
$var_replace = array(
|
||||
SITEURL,
|
||||
$user_data['user_name'],
|
||||
$user_data['user_login'],
|
||||
$savePassword,
|
||||
$user_data['user_email']
|
||||
);
|
||||
|
||||
$e_message = str_replace($var_search,$var_replace,$QUICKADDUSER_TEMPLATE);
|
||||
|
||||
if (sendemail($user_data['user_email'],USRLAN_187.SITEURL,$e_message,$user_data['user_login'],'',''))
|
||||
{
|
||||
|
@ -1227,7 +1227,15 @@ class e107
|
||||
{
|
||||
return self::getSingleton('e_ranks', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve plugin handler singleton object
|
||||
* @return e_ranks
|
||||
*/
|
||||
public static function getPlugin()
|
||||
{
|
||||
return self::getSingleton('e107plugin', true);
|
||||
}
|
||||
/**
|
||||
* Retrieve online users handler singleton object
|
||||
* @return e_online
|
||||
|
@ -1876,6 +1876,39 @@ class e107plugin
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// return the Icon of the
|
||||
function getIcon($plugName='',$size=32)
|
||||
{
|
||||
if(!$plugName) return;
|
||||
|
||||
if(!isset($this->parsed_plugin[$plugName]))
|
||||
{
|
||||
$plug_vars = $this->parse_plugin($plugName);
|
||||
}
|
||||
else
|
||||
{
|
||||
$plug_vars = $this->parsed_plugin[$plugName];
|
||||
}
|
||||
|
||||
//return print_r($plug_vars,TRUE);
|
||||
|
||||
$sizeArray = array(32=>'icon', 16=>'iconSmall');
|
||||
$default = ($size == 32) ? E_32_CAT_PLUG : "<img class='icon S16' src='".E_16_CAT_PLUG."' alt='' />";
|
||||
$sz = $sizeArray[$size];
|
||||
|
||||
$icon_src = (isset($plug_vars['plugin_php'])) ? e_PLUGIN : e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz];
|
||||
$plugin_icon = $plug_vars['administration'][$sz] ? "<img src='{$icon_src}' alt='' class='icon S".intval($size)."' />" : $default;
|
||||
|
||||
if(!$plugin_icon)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
return $plugin_icon;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Called to parse the (deprecated) plugin.php file
|
||||
function parse_plugin_php($plugName)
|
||||
|
@ -917,11 +917,28 @@ class e_userperms
|
||||
$sql = e107::getDb('sql2');
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
$plg = e107::getPlugin();
|
||||
$installed = $plg->getall(1);
|
||||
|
||||
// print_a($installed);
|
||||
foreach($installed as $k=>$row2)
|
||||
{
|
||||
if($plg->parse_plugin($row2['plugin_path']))
|
||||
{
|
||||
$plug_vars = $plg->plug_vars;
|
||||
$this->plugin_perms[("P".$row2['plugin_id'])] = array($tp->toHTML($row2['plugin_name'], FALSE, 'RAWTEXT,defs'));
|
||||
$this->plugin_perms[("P".$row2['plugin_id'])][1] = $plg->getIcon($row2['plugin_path'],16);
|
||||
$this->plugin_perms[("P".$row2['plugin_id'])][2] = $plg->getIcon($row2['plugin_path'],32);
|
||||
}
|
||||
}
|
||||
|
||||
// echo $plg->getIcon('forum');
|
||||
|
||||
$sql->db_Select("plugin", "*", "plugin_installflag='1'");
|
||||
while ($row2 = $sql->db_Fetch())
|
||||
{
|
||||
$this->plugin_perms[("P".$row2['plugin_id'])] = $tp->toHTML($row2['plugin_name'], FALSE, 'RAWTEXT,defs');
|
||||
// $this->plugin_perms[("P".$row2['plugin_id'])] = array($tp->toHTML($row2['plugin_name'], FALSE, 'RAWTEXT,defs'));
|
||||
// $this->plugin_perms[("P".$row2['plugin_id'])][1] = $plg->getIcon('forum')
|
||||
}
|
||||
|
||||
asort($this->plugin_perms);
|
||||
|
Loading…
x
Reference in New Issue
Block a user