mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
More work on user administrators - plugin icons.
This commit is contained in:
@@ -335,7 +335,22 @@ if (isset ($_POST['adduser']))
|
|||||||
$QUICKADDUSER_TEMPLATE = USRLAN_185.USRLAN_186;
|
$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'],'',''))
|
if (sendemail($user_data['user_email'],USRLAN_187.SITEURL,$e_message,$user_data['user_login'],'',''))
|
||||||
{
|
{
|
||||||
|
@@ -1228,6 +1228,14 @@ class e107
|
|||||||
return self::getSingleton('e_ranks', true);
|
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
|
* Retrieve online users handler singleton object
|
||||||
* @return e_online
|
* @return e_online
|
||||||
|
@@ -1877,6 +1877,39 @@ class e107plugin
|
|||||||
return $ret;
|
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
|
// Called to parse the (deprecated) plugin.php file
|
||||||
function parse_plugin_php($plugName)
|
function parse_plugin_php($plugName)
|
||||||
{
|
{
|
||||||
|
@@ -917,11 +917,28 @@ class e_userperms
|
|||||||
$sql = e107::getDb('sql2');
|
$sql = e107::getDb('sql2');
|
||||||
$tp = e107::getParser();
|
$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'");
|
$sql->db_Select("plugin", "*", "plugin_installflag='1'");
|
||||||
while ($row2 = $sql->db_Fetch())
|
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);
|
asort($this->plugin_perms);
|
||||||
|
Reference in New Issue
Block a user