mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-29 11:50:56 +00:00
bug fix: added template path option in .info file
This commit is contained in:
parent
1546cfc57a
commit
c1f7aa6220
5 changed files with 26 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* API for loading and interacting with plugins
|
||||
|
@ -163,7 +163,6 @@ class Plugincache {
|
|||
|
||||
/**
|
||||
* some more plugin function that requires during plugin operations
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -173,13 +172,13 @@ class Plugincache {
|
|||
* @return boolean
|
||||
*/
|
||||
public static function rrmdir( $dir ) {
|
||||
$result=array_diff(scandir($dir),array('.','..'));
|
||||
foreach($result as $item)
|
||||
$result = array_diff( scandir( $dir ), array( '.', '..' ) );
|
||||
foreach( $result as $item )
|
||||
{
|
||||
if(!@unlink($dir.'/'.$item))
|
||||
Plugincache::rrmdir($dir.'/'.$item);
|
||||
if ( !@unlink( $dir . '/' . $item ) )
|
||||
Plugincache :: rrmdir( $dir . '/' . $item );
|
||||
}
|
||||
return rmdir($dir);
|
||||
return rmdir( $dir );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -247,20 +246,24 @@ class Plugincache {
|
|||
foreach( $ac_arr as $key => $value )
|
||||
{
|
||||
$plugin_path = Plugincache :: pluginInfoUsingId( $value['Id'], 'FileName' );
|
||||
$pluginName = Plugincache :: pluginInfoUsingId( $value['Id'], 'Name' );
|
||||
$template_path = json_decode( Plugincache :: pluginInfoUsingId( $value['Id'], 'Info' ) ) -> TemplatePath;
|
||||
$plugin_name = explode( '/', $plugin_path )[4];
|
||||
|
||||
// calling hooks in the $pluginName.php
|
||||
include $plugin_path . '/' . strtolower( $pluginName ) . '.php';
|
||||
include $plugin_path . '/' . $plugin_name . '.php';
|
||||
$arr = get_defined_functions();
|
||||
|
||||
foreach( $arr['user'] as $key => $value )
|
||||
{
|
||||
if ( stristr( $value, strtolower( $pluginName ) ) == true )
|
||||
if ( stristr( $value, $plugin_name ) == true )
|
||||
{
|
||||
$content['hook_info'][$pluginName] = call_user_func( $value );
|
||||
$content['hook_info'][$plugin_name] = call_user_func( $value );
|
||||
}
|
||||
}
|
||||
// path for the template
|
||||
$content['hook_info'][$plugin_name]['TemplatePath'] = $template_path;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Actions</li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=plugins"><i class="icon-th-list"></i><span class="hidden-tablet"> Plugins</span></a></li>
|
||||
{if isset($hook_info)} {foreach from=$hook_info item=element}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&&name={$element.menu_display}"><i class="icon-th-list"></i><span class="hidden-tablet"> {$element.menu_display}</span></a></li>{/foreach}{/if}
|
||||
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&&name={$arrkey}"><i class="icon-th-list"></i><span class="hidden-tablet"> {$element.menu_display}</span></a></li>{/foreach}{/if}
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=syncing"><i class="icon-th-list"></i><span class="hidden-tablet"> Syncing</span></a></li>
|
||||
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>
|
||||
{/block}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Admin</li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=userlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Users</span></a></li>
|
||||
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&&name={$arrkey}"><i class="icon-th-list"></i><span class="hidden-tablet"> {$element.menu_display}</span></a></li>{/foreach}{/if}
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_queue&get=todo"><i class="icon-th-list"></i><span class="hidden-tablet"> Queues</span></a></li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=sgroup_list"><i class="icon-briefcase"></i><span class="hidden-tablet"> Support Groups</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Actions</li>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{block name=content}
|
||||
<div class="row-fluid">
|
||||
{if isset($hook_info)}
|
||||
{foreach from=$hook_info item=element}
|
||||
{if $element.menu_display eq $smarty.get.name}
|
||||
{foreach from=$hook_info key=arrkey item=element}
|
||||
{if $arrkey eq $smarty.get.name}
|
||||
{include file=$element.template_path}
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=settings"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Actions</li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=createticket"><i class="icon-pencil"></i><span class="hidden-tablet">Create New Ticket</span></a></li>
|
||||
{if isset($hook_info)} {foreach from=$hook_info item=element}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&&name={$element.menu_display}"><i class="icon-th-list"></i><span class="hidden-tablet"> {$element.menu_display}</span></a></li>{/foreach}{/if}
|
||||
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&&name={$arrkey}"><i class="icon-th-list"></i><span class="hidden-tablet"> {$element.menu_display}</span></a></li>{/foreach}{/if}
|
||||
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>
|
||||
{/block}
|
||||
|
||||
|
|
Loading…
Reference in a new issue