This commit is contained in:
botanic 2014-09-07 05:40:29 -07:00
commit dfb748b06f
11 changed files with 477 additions and 20 deletions

View file

@ -261,8 +261,13 @@ class Plugincache {
$arr = get_defined_functions();
foreach ($arr['user'] as $key => $value) {
if (stristr( $value, $plugin_name) == true) {
switch (strtolower($value)) {
case strtolower($plugin_name).'_hook_display':
case strtolower($plugin_name).'_hook_call_rest':
case strtolower($plugin_name).'_hook_get_db':
case strtolower($plugin_name).'_hook_return_global':
$content['hook_info'][$plugin_name] = call_user_func($value);
break;
}
}
// path for the template

View file

@ -27,6 +27,7 @@ function api_key_management_hook_display()
global $return_set;
// to display plugin name in menu bar
$return_set['menu_display'] = 'API Key Management';
$return_set['icon'] = 'icon-download-alt';
}
/**

View file

@ -17,7 +17,7 @@
// Global variable to store the data which is
// returned to the templates
$return_set = array();
$achievements_return_set = array();
// Local variable to store data during
// functionalities of the hooks
@ -28,9 +28,10 @@ $var_set = array();
*/
function achievements_hook_display()
{
global $return_set;
global $achievements_return_set;
// to display plugin name in menu bar
$return_set['menu_display'] = 'Achievements';
$achievements_return_set['menu_display'] = 'Achievements';
$achievements_return_set['icon'] = 'icon-certificate';
}
/**
@ -97,7 +98,7 @@ function hook_get_player_stat( $data )
*/
function hook_variable_set()
{
global $return_set;
global $achievements_return_set;
global $var_set;
if ( isset( $_POST['Character'] ) && !empty( $_POST['Character'] ) )
{
@ -132,7 +133,7 @@ function hook_variable_set()
}
else
{
$return_set['no_char'] = "Please Generate key for a character before requesting for achievements";
$achievements_return_set['no_char'] = "Please Generate key for a character before requesting for achievements";
}
}
@ -146,13 +147,13 @@ function hook_variable_set()
* appkey --> app key for authentication
* host --> host from which request have been sent
*
* @return $return_set global array returns the template data
* @return $achievements_return_set global array returns the template data
*/
function achievements_hook_call_rest()
{
// defined the variables
global $var_set;
global $return_set;
global $achievements_return_set;
if ( isset( $_POST['get_data'] ) )
{
@ -161,7 +162,7 @@ function achievements_hook_call_rest()
$rest_api = new Rest_Api();
$ach_data = $rest_api -> request( $var_set['url'], $var_set['app_key'], $var_set['host'], $var_set['items'] );
// here we store the response we get from the server
$return_set['char_achievements'] = $ach_data ;
$achievements_return_set['char_achievements'] = $ach_data ;
}
}
@ -170,11 +171,11 @@ function achievements_hook_call_rest()
* the content to use in the smarty templates extracted from
* the database
*
* @return $return_set global array returns the template data
* @return $achievements_return_set global array returns the template data
*/
function achievements_hook_get_db()
{
global $return_set;
global $achievements_return_set;
if ( isset( $_SESSION['user'] ) )
{
@ -183,7 +184,7 @@ function achievements_hook_get_db()
// getting content for selecting characters
$sth = $db -> selectWithParameter( 'UserCharacter', 'ams_api_keys', array( 'User' => $_SESSION['user'] ) , 'User = :User' );
$row = $sth -> fetch();
$return_set['Character'] = $row;
$achievements_return_set['Character'] = $row;
}
}
@ -191,10 +192,10 @@ function achievements_hook_get_db()
* Global Hook to return global variables which contains
* the content to use in the smarty templates
*
* @return $return_set global array returns the template data
* @return $achievements_return_set global array returns the template data
*/
function achievements_hook_return_global()
{
global $return_set;
return $return_set;
global $achievements_return_set;
return $achievements_return_set;
}

View file

@ -1,5 +1,4 @@
{block name=content}
{if isset($smarty.get.plugin_action) and $smarty.get.plugin_action eq 'get_achievements'}
<div class="row-fluid">
<div class="box col-md-12">

View file

@ -0,0 +1,8 @@
PluginName = Domain_Management
Description = Plug-in for Domain Management.
Version = 1.0.0
TemplatePath = ../../../private_php/ams/plugins/Domain_Management/templates/index.tpl
Type = Manual

View file

@ -0,0 +1,205 @@
<?php
/**
* Global and Local Hooks for the Domain_Management plugin
* Global Hooks are defined with the prefix(name of the plugin)
* Local Hooks are defined with normal function name
*
* All the Global Hooks are called during the page load
* and Local Hooks are called according to conditions
*
* Here, we request to the Domain_Management url using REST
* to get the contents and will display with this plugin.
*
* @author shubham meena mentored by Matthew Lagoe
*/
// Global variable to store the data which is
// returned to the templates
$domain_management_return_set = array();
// Local variable to store data during
// functionalities of the hooks
$var_set = array();
/**
* Display hook for Domain_Management plugin
*/
function domain_management_hook_display()
{
global $domain_management_return_set;
// to display plugin name in menu bar
$domain_management_return_set['admin_menu_display'] = 'Domain Management';
$domain_management_return_set['icon'] = 'icon-edit';
}
/**
* Local Hook to get database content
* which is called by the global hook
* by passing a parameter
*
* This hook returns the api keys registerd with
* the logged in user
*
* @param $data array with respective information
* @return $row extracted db content wrt $data
*/
function domain_management_get_db_content( $data )
{
$db = new DBLayer( 'lib' );
$sth = $db -> select( 'ams_api_keys', $data , 'User = :User AND UserCharacter = :UserCharacter' );
$row = $sth -> fetchAll();
return $row;
}
/**
* Local Hook to get database content
* which is called by the global hook
* by passing a parameter
*
* This hook returns the id of the character
* whose achivements we have to get
*
* @param $data array with respective information
* @return $row extracted db content wrt $data
*/
function domain_management_get_char_id( $data )
{
// returns the character id with respect to the character name in the ring_tool->characters
$db = new DBLayer( 'ring' );
$sth = $db -> selectWithParameter( 'char_id', 'characters' , array( 'char_name' => $data ), 'char_name=:char_name' );
$row = $sth -> fetch();
return $row['char_id'];
}
/**
* Local Hook to get database content
* which is called by the global hook
* by passing a parameter
*
* Hook to get the player stats of the character
*
* @param $data array with respective information
* @return $row extracted db content wrt $data
*/
function domain_management_get_player_stat( $data )
{
// returns the character id with respect to the character name in the ring_tool->characters
$db = new DBLayer( 'webig' );
$sth = $db -> select( 'players' , array( 'name' => $data ), 'name=:name' );
$row = $sth -> fetch();
return $row;
}
/**
* Local Hook to set variables which contains
* the content to use during the plugin functionality.
*/
function domain_management_variable_set()
{
global $domain_management_return_set;
global $var_set;
if ( isset( $_POST['Character'] ) && !empty( $_POST['Character'] ) )
{
$var_set['character'] = $_POST['Character'];
// get char id from ring_open table
if ( $var_set['character'] != 'All Characters' )
{
$var_set['char_id'] = domain_management_get_char_id( $var_set['character'] );
}
// get db content for variable set
$row = domain_management_get_db_content( array( 'User' => $_SESSION['user'], 'UserCharacter' => $var_set['character'] ) );
// access key automatically taken from the database wrt user and character
@$var_set['app_key'] = $row['AccessToken'];
// here you can set the host where this plugin is set
$var_set['host'] = 'localhost';
// here we get the stats of the character
$ref_set = domain_management_get_player_stat( $var_set['character'] );
// here we have set items that are required to get the achivements
// these are player stats from webig->players table
@$var_set['items'] = json_encode( array( 'dev_shard' => $ref_set['dev_shard'] , 'name' => $ref_set['name'] , 'cid' => $ref_set['cid'] , 'lang' => 'en' , 'translater_mode' => '', 'last_played_date' => $ref_set['last_login'] ) );
// url where we have to make request for domain_management
// it sends get parameter search(what to search) and format(in which format data exchange takes place)
$var_set['url'] = 'http://localhost6/?search=domain_management&&format=json';
}
else
{
$domain_management_return_set['no_char'] = "Please Generate key for a character before requesting for domain_management";
}
}
/**
* Global Hook to interact with the REST api
* Pass the variables in the REST object to
* make request
*
* variables REST object expects
* url --> on which request is to be made
* appkey --> app key for authentication
* host --> host from which request have been sent
*
* @return $domain_management_return_set global array returns the template data
*/
function domain_management_hook_call_rest()
{
global $domain_management_return_set;
global $WEBPATH;
$domain_management_return_set['path'] = $WEBPATH;
}
/**
* Global Hook to return global variables which contains
* the content to use in the smarty templates extracted from
* the database
*
* @return $domain_management_return_set global array returns the template data
*/
function domain_management_hook_get_db()
{
global $domain_management_return_set;
$db = new DBLayer( 'shard' );
//get all domains
$statement = $db->executeWithoutParams("SELECT * FROM domain");
$rows = $statement->fetchAll();
$domain_management_return_set['domains'] = $rows;
if (isset($_GET['edit_domain'])){
//get permissions
$statement = $db->executeWithoutParams("SELECT * FROM `permission` WHERE `ClientApplication` = '".$rows[$_GET['edit_domain']-1]['domain_name']."'");
$rows = $statement->fetchAll();
$domain_management_return_set['permissions'] = $rows;
//get all users
$pagination = new Pagination(WebUsers::getAllUsersQuery(),"web",10,"WebUsers");
$domain_management_return_set['userlist'] = Gui_Elements::make_table($pagination->getElements() , Array("getUId","getUsername","getEmail"), Array("id","username","email"));
}
return $rows;
}
/**
* Global Hook to return global variables which contains
* the content to use in the smarty templates
*
* @return $domain_management_return_set global array returns the template data
*/
function domain_management_hook_return_global()
{
global $domain_management_return_set;
return $domain_management_return_set;
}

View file

@ -0,0 +1,209 @@
{block name=content}
{if isset($smarty.get.edit_domain)}
<div class="row-fluid sortable ui-sortable">
<div class="box col-md-9">
<div class="box-inner">
<div class="box-header well" data-original-title="">
<h2><i class="icon-list"></i> {$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['domain_name']}</h2>
</div>
<div class="box-content">
<div class="row-fluid">
<legend>Users with permissions in domain </legend>
<table class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>User ID</th>
<th>Username</th>
<th>Permissions</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$hook_info['Domain_Management']['userlist'] item=element}
<tr>
<td>{$element.id}</td>
<td class="center"><a href="index.php?page=show_user&id={$element.id}">{$element.username}</a></td>
<td class="center">{$hook_info['Domain_Management']['permissions'][{$element.id}-1]['AccessPrivilege']}</td>
<td class="center">
<div class="btn-group" style="display: inline-block;">
<a class="btn btn-info" href="index.php?page=settings&id={$element.id}"><i class=" icon-pencil icon-white"></i> Edit User Permissions</a>
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
</div><!--/span-->
<div class="box col-md-3">
<div class="box-inner">
<div class="box-header well" data-original-title="">
<h2><i class="icon-pencil"></i> Modify Domain Settings</h2>
</div>
<div class="box-content">
<div class="row-fluid">
<form id="modifyMailSGroup" class="form-vertical" method="post" action="index.php?page=show_sgroup&id=">
<legend style="margin:0"> Domain Settings of '{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['domain_name']}'</legend>
<div class="control-group disabled" style="display: inline-block; ">
<label class="control-label">Domain ID</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="domain_id" name="domain_id" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['domain_id']}" disabled>
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Domain Name</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="domain_name" name="domain_name" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['domain_name']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Domain Status</label>
<div class="controls">
<select id="status" multiple class="form-control" data-rel="chosen">
<option {if {$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['status']} eq "ds_close"}selected{/if}>ds_close</option>
<option {if {$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['status']} eq "ds_dev"}selected{/if}>ds_dev</option>
<option {if {$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['status']} eq "ds_restricted"}selected{/if}>ds_restricted</option>
<option {if {$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['status']} eq "ds_open"}selected{/if}>ds_open</option>
</select>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Patch Version</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="patch_version" name="patch_version" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['patch_version']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Backup Patch URL</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="backup_patch_url" name="backup_patch_url" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['backup_patch_url']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Patch URLs</label>
<div class="controls">
<div class="input-prepend">
<textarea id="patch_urls" name="patch_urls" >{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['patch_urls']}</textarea>
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Login Address</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="login_address" name="login_address" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['login_address']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Session Manager Address</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="session_manager_address" name="session_manager_address" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['session_manager_address']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Ring DB Name</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="ring_db_name" name="ring_db_name" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['ring_db_name']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Web Host</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="web_host" name="web_host" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['web_host']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Web Host PHP</label>
<div class="controls">
<div class="input-prepend">
<input type="text" id="web_host_php" name="web_host_php" value="{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['web_host_php']}">
</div>
</div>
</div>
<div class="control-group" style="display: inline-block; ">
<label class="control-label">Description</label>
<div class="controls">
<div class="input-prepend">
<textarea id="description" name="description" >{$hook_info['Domain_Management']['domains'][$smarty.get.edit_domain-1]['description']}</textarea>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<button type="submit" class="btn btn-primary" >Update</button>
</div>
</div>
{if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "SUCCESS"}
<div class="alert alert-success">
{$modify_mail_of_group_success}
</div>
{/if}
</form>
</div>
</div>
</div>
</div>
</div><!--/row-->
{else}
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Domain ID</th>
<th>Domain Name</th>
<th>Status</th>
<th>Patch Version</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{foreach from=$hook_info['Domain_Management']['domains'] item=array}
<tr>
<td><a href="{$hook_info['Domain_Management']['path']}?page=layout_plugin&name=Domain_Management&edit_domain={$array['domain_id']}">{$array['domain_id']}</a></td>
<td><a href="{$hook_info['Domain_Management']['path']}?page=layout_plugin&name=Domain_Management&edit_domain={$array['domain_id']}">{$array['domain_name']}</a></td>
<td><a href="{$hook_info['Domain_Management']['path']}?page=layout_plugin&name=Domain_Management&edit_domain={$array['domain_id']}">{$array['status']}</a></td>
<td><a href="{$hook_info['Domain_Management']['path']}?page=layout_plugin&name=Domain_Management&edit_domain={$array['domain_id']}">{$array['patch_version']}</a></td>
<td><a href="{$hook_info['Domain_Management']['path']}?page=layout_plugin&name=Domain_Management&edit_domain={$array['domain_id']}">{$array['description']|truncate}</a></td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{/block}

View file

@ -0,0 +1,28 @@
-- phpMyAdmin SQL Dump
-- version 4.2.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 04, 2014 at 09:28 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Dumping data for table `plugins`
--
INSERT INTO `plugins` (`Id`, `FileName`, `Name`, `Type`, `Owner`, `Permission`, `Status`, `Weight`, `Info`) VALUES
(3, 'Domain_Management', 'Domain_Management', 'Manual', '', 'admin', 1, 0, '{"PluginName":"Domain Management","Description":"Plug-in for Domain Management.","Version":"1.0.0","TemplatePath":"..\\/..\\/..\\/private_php\\/ams\\/plugins\\/Domain_Management\\/templates\\/index.tpl","Type":"Manual","":null}');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View file

@ -4,11 +4,12 @@
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_user"><i class="icon-user"></i><span class="hidden-tablet"> Profile</span></a></li>
<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>
{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}
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}{if isset($element['menu_display'])}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&name={$arrkey}"><i class="{$element.icon}"></i><span class="hidden-tablet"> {$element['menu_display']}</span></a></li>{/if}{/foreach}{/if}
<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>
<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>
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}{if isset($element.admin_menu_display)}<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=layout_plugin&name={$arrkey}"><i class="{$element.icon}"></i><span class="hidden-tablet"> {$element.admin_menu_display}</span></a></li>{/if}{/foreach}{/if}
<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>
<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>

View file

@ -4,7 +4,7 @@
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_user"><i class="icon-user"></i><span class="hidden-tablet"> Profile</span></a></li>
<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>
{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}
{if isset($hook_info)} {foreach from=$hook_info key=arrkey item=element}{if isset($element.menu_display)}<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>{/if]{/foreach}{/if}
<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>
<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>

View file

@ -3,7 +3,7 @@
<li class="nav-header hidden-tablet">Main</li>
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=show_user"><i class="icon-user"></i><span class="hidden-tablet">Profile</span></a></li>
<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>
{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}
{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 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>
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>