本文整理汇总了PHP中Tab::getTabs方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::getTabs方法的具体用法?PHP Tab::getTabs怎么用?PHP Tab::getTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::getTabs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProfileAccesses
public static function getProfileAccesses($id_profile, $type = 'id_tab')
{
if (!in_array($type, array('id_tab', 'class_name'))) {
return false;
}
if (!isset(self::$_cache_accesses[$id_profile])) {
self::$_cache_accesses[$id_profile] = array();
}
if (!isset(self::$_cache_accesses[$id_profile][$type])) {
self::$_cache_accesses[$id_profile][$type] = array();
// Super admin profile has full auth
if ($id_profile == _PS_ADMIN_PROFILE_) {
foreach (Tab::getTabs(Context::getContext()->language->id) as $tab) {
self::$_cache_accesses[$id_profile][$type][$tab[$type]] = array('id_profile' => _PS_ADMIN_PROFILE_, 'id_tab' => $tab['id_tab'], 'class_name' => $tab['class_name'], 'view' => '1', 'add' => '1', 'edit' => '1', 'delete' => '1');
}
} else {
$result = Db::getInstance()->executeS('
SELECT *
FROM `' . _DB_PREFIX_ . 'access` a
LEFT JOIN `' . _DB_PREFIX_ . 'tab` t ON t.id_tab = a.id_tab
WHERE `id_profile` = ' . (int) $id_profile);
foreach ($result as $row) {
self::$_cache_accesses[$id_profile][$type][$row[$type]] = $row;
}
}
}
return self::$_cache_accesses[$id_profile][$type];
}
示例2: renderForm
/**
* AdminController::renderForm() override
* @see AdminController::renderForm()
*/
public function renderForm()
{
$current_profile = (int) $this->getCurrentProfileId();
$profiles = Profile::getProfiles($this->context->language->id);
$tabs = Tab::getTabs($this->context->language->id);
$accesses = array();
foreach ($profiles as $profile) {
$accesses[$profile['id_profile']] = Profile::getProfileAccesses($profile['id_profile']);
}
// Deleted id_tab that do not have access
foreach ($tabs as $key => $tab) {
// Don't allow permissions for unnamed tabs (ie. AdminLogin)
if (empty($tab['name'])) {
unset($tabs[$key]);
}
foreach ($this->accesses_black_list as $id_tab) {
if ($tab['id_tab'] == (int) $id_tab) {
unset($tabs[$key]);
}
}
}
$modules = array();
foreach ($profiles as $profile) {
$modules[$profile['id_profile']] = Module::getModulesAccessesByIdProfile($profile['id_profile']);
uasort($modules[$profile['id_profile']], array($this, 'sortModuleByName'));
}
$this->fields_form = array('');
$this->tpl_form_vars = array('profiles' => $profiles, 'accesses' => $accesses, 'id_tab_parentmodule' => (int) Tab::getIdFromClassName('AdminParentModules'), 'id_tab_module' => (int) Tab::getIdFromClassName('AdminModules'), 'tabs' => $this->displayTabs($tabs), 'current_profile' => (int) $current_profile, 'admin_profile' => (int) _PS_ADMIN_PROFILE_, 'access_edit' => $this->access('edit'), 'perms' => array('view', 'add', 'edit', 'delete'), 'modules' => $modules, 'link' => $this->context->link);
return parent::renderForm();
}
示例3: displayForm
public function displayForm($isMainTab = true)
{
global $cookie, $currentIndex;
parent::displayForm();
$currentProfile = (int) $this->getCurrentProfileId();
$tabs = Tab::getTabs($cookie->id_lang);
$profiles = Profile::getProfiles((int) $cookie->id_lang);
$accesses = Profile::getProfileAccesses((int) $currentProfile);
echo '
<script type="text/javascript">
setLang(Array(\'' . $this->l('Profile updated') . '\', \'' . $this->l('Request failed!') . '\', \'' . $this->l('Update in progress. Please wait.') . '\', \'' . $this->l('Server connection failed!') . '\'));
</script>
<div id="ajax_confirmation"></div>
<table class="table" cellspacing="0">
<tr>
<th ' . ($currentProfile == (int) _PS_ADMIN_PROFILE_ ? 'colspan="6"' : '') . '>
<select name="profile" onchange="redirect(\'' . Tools::getHttpHost(true, true) . $currentIndex . '&token=' . $this->token . '&profile=\'+this.options[this.selectedIndex].value)">';
if ($profiles) {
foreach ($profiles as $profile) {
echo '<option value="' . (int) $profile['id_profile'] . '" ' . ((int) $profile['id_profile'] == $currentProfile ? 'selected="selected"' : '') . '>' . $profile['name'] . '</option>';
}
}
$tabsize = sizeof($tabs);
foreach ($tabs as $tab) {
if ($tab['id_tab'] > $tabsize) {
$tabsize = $tab['id_tab'];
}
}
echo '
</select>
</th>';
if ($currentProfile != (int) _PS_ADMIN_PROFILE_) {
echo '
<th class="center">' . $this->l('View') . '<br /><input type="checkbox" name="1" id="viewall" onclick="ajax_power(this, \'view\', -1, ' . $currentProfile . ', \'' . $this->token . '\', \'' . $tabsize . '\', \'' . sizeof($tabs) . '\')" /></th>
<th class="center">' . $this->l('Add') . '<br /><input type="checkbox" name="1" id="addall" onclick="ajax_power(this, \'add\', -1, ' . $currentProfile . ', \'' . $this->token . '\', \'' . $tabsize . '\', \'' . sizeof($tabs) . '\')" /></th>
<th class="center">' . $this->l('Edit') . '<br /><input type="checkbox" name="1" id="editall" onclick="ajax_power(this, \'edit\', -1, ' . $currentProfile . ', \'' . $this->token . '\', \'' . $tabsize . '\', \'' . sizeof($tabs) . '\')" /></th>
<th class="center">' . $this->l('Delete') . '<br /><input type="checkbox" name="1" id="deleteall" onclick="ajax_power(this, \'delete\', -1, ' . $currentProfile . ', \'' . $this->token . '\', \'' . $tabsize . '\', \'' . sizeof($tabs) . '\')" /></th>
<th class="center">' . $this->l('All') . '<br /><input type="checkbox" name="1" id="allall" onclick="ajax_power(this, \'all\', -1, ' . $currentProfile . ', \'' . $this->token . '\', \'' . $tabsize . '\', \'' . sizeof($tabs) . '\')" /></th>
</tr>';
}
if (!sizeof($tabs)) {
echo '<tr><td colspan="5">' . $this->l('No tab') . '</td></tr>';
} elseif ($currentProfile == (int) _PS_ADMIN_PROFILE_) {
echo '<tr><td colspan="5">' . $this->l('Administrator permissions cannot be modified.') . '</td></tr>';
} else {
foreach ($tabs as $tab) {
if (!$tab['id_parent'] or (int) $tab['id_parent'] == -1) {
$this->printTabAccess((int) $currentProfile, $tab, $accesses[$tab['id_tab']], false, $tabsize, sizeof($tabs));
foreach ($tabs as $child) {
if ($child['id_parent'] === $tab['id_tab']) {
if (isset($accesses[$child['id_tab']])) {
$this->printTabAccess($currentProfile, $child, $accesses[$child['id_tab']], true, $tabsize, sizeof($tabs));
}
}
}
}
}
}
echo '</table>';
}
示例4: __construct
public function __construct()
{
$this->table = 'employee';
$this->className = 'Employee';
$this->lang = false;
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->context = Context::getContext();
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
/*
check if there are more than one superAdmin
if it's the case then we can delete a superAdmin
*/
$super_admin = Employee::countProfile(_PS_ADMIN_PROFILE_, true);
if ($super_admin == 1) {
$super_admin_array = Employee::getEmployeesByProfile(_PS_ADMIN_PROFILE_, true);
$super_admin_id = array();
foreach ($super_admin_array as $key => $val) {
$super_admin_id[] = $val['id_employee'];
}
$this->addRowActionSkipList('delete', $super_admin_id);
}
$profiles = Profile::getProfiles($this->context->language->id);
if (!$profiles) {
$this->errors[] = Tools::displayError('No profile');
} else {
foreach ($profiles as $profile) {
$this->profiles_array[$profile['name']] = $profile['name'];
}
}
$this->fields_list = array('id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'lastname' => array('title' => $this->l('Last name'), 'width' => 'auto'), 'firstname' => array('title' => $this->l('First name'), 'width' => 130), 'email' => array('title' => $this->l('E-mail address'), 'width' => 180), 'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'), 'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'width' => 30));
$this->fields_options = array('general' => array('title' => $this->l('Employee options'), 'fields' => array('PS_PASSWD_TIME_BACK' => array('title' => $this->l('Password regeneration'), 'desc' => $this->l('Security: minimum time to wait between two password changes'), 'cast' => 'intval', 'size' => 5, 'type' => 'text', 'suffix' => ' ' . $this->l('minutes'), 'visibility' => Shop::CONTEXT_ALL), 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array('title' => $this->l('Memorize language used in Admin panel forms'), 'desc' => $this->l('Allow employees to select a specific language for Admin panel forms'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array('0' => array('value' => 0, 'name' => $this->l('No')), '1' => array('value' => 1, 'name' => $this->l('Yes'))), 'visibility' => Shop::CONTEXT_ALL)), 'submit' => array()));
$path = _PS_ADMIN_DIR_ . '/themes/';
foreach (scandir($path) as $theme) {
if ($theme[0] != '.' && is_dir($path . $theme) && file_exists($path . $theme . '/css/admin.css')) {
$this->themes[] = $theme;
}
}
$home_tab = Tab::getInstanceFromClassName('adminHome');
$this->tabs_list[$home_tab->id] = array('name' => $home_tab->name[$this->context->language->id], 'id_tab' => $home_tab->id, 'children' => array(array('id_tab' => $home_tab->id, 'name' => $home_tab->name[$this->context->language->id])));
foreach (Tab::getTabs($this->context->language->id, 0) as $tab) {
if (Tab::checkTabRights($tab['id_tab'])) {
$this->tabs_list[$tab['id_tab']] = $tab;
foreach (Tab::getTabs($this->context->language->id, $tab['id_tab']) as $children) {
if (Tab::checkTabRights($children['id_tab'])) {
$this->tabs_list[$tab['id_tab']]['children'][] = $children;
}
}
}
}
parent::__construct();
// An employee can edit its own profile
if ($this->context->employee->id == Tools::getValue('id_employee')) {
$this->tabAccess['view'] = '1';
if (!$this->tabAccess['edit']) {
$this->restrict_edition = true;
}
$this->tabAccess['edit'] = '1';
}
}
示例5: _displayForm
private function _displayForm()
{
global $cookie, $smarty;
$tabsInfo = Tab::getTabs($cookie->id_lang, 0);
$smarty->assign(array('tabsInfo'=>$tabsInfo,
'selectedTab'=>Configuration::get('NSletter_id_parent_tab')));
return $this->display(__FILE__, 'adminform.tpl');
}
示例6: displayForm
public function displayForm($isMainTab = true)
{
global $cookie, $currentIndex;
parent::displayForm();
$currentProfile = (int) Tools::getValue('id_profile');
if (!$currentProfile) {
$currentProfile = 1;
}
$tabs = Tab::getTabs((int) $cookie->id_lang);
$profiles = Profile::getProfiles((int) $cookie->id_lang);
$permissions = Profile::getProfileAccesses((int) $currentProfile);
echo '
<form action="' . $currentIndex . '&submitAddPermissions=1&token=' . $this->token . '" id="form_permissions" method="post">
<input type="hidden" name="id_profile" value="' . (int) $currentProfile . '" />
<table class="table" cellspacing="0">
<tr>
<th ' . ($currentProfile == (int) _PS_ADMIN_PROFILE_ ? 'colspan="6"' : '') . '>' . $this->l('Profile') . '
<select name="id_profile" onchange="window.location = \'' . Tools::getHttpHost(true, true) . $currentIndex . '&token=' . $this->token . '&id_profile=\'+this.options[this.selectedIndex].value;">';
if ($profiles) {
foreach ($profiles as $profile) {
echo '<option value="' . (int) $profile['id_profile'] . '" ' . ((int) $profile['id_profile'] == $currentProfile ? 'selected="selected"' : '') . '>' . Tools::safeOutput($profile['name']) . '</option>';
}
}
echo '
</select>
</th>';
if ($currentProfile != (int) _PS_ADMIN_PROFILE_) {
echo '
<th class="center">' . $this->l('View') . '<br /><input type="checkbox" name="1" id="viewall" /></th>
<th class="center">' . $this->l('Add') . '<br /><input type="checkbox" name="1" id="addall" /></th>
<th class="center">' . $this->l('Edit') . '<br /><input type="checkbox" name="1" id="editall" /></th>
<th class="center">' . $this->l('Delete') . '<br /><input type="checkbox" name="1" id="deleteall" /></th>
<th class="center">' . $this->l('All') . '<br /><input type="checkbox" name="1" id="allall" /></th>
</tr>';
}
if (!count($tabs)) {
echo '<tr><td colspan="5">' . $this->l('No tab') . '</td></tr>';
} elseif ($currentProfile == (int) _PS_ADMIN_PROFILE_) {
echo '<tr><td colspan="5">' . $this->l('Administrator permissions cannot be modified.') . '</td></tr>';
} else {
foreach ($tabs as $tab) {
if (!$tab['id_parent'] || (int) $tab['id_parent'] == -1) {
echo $this->printTabAccess((int) $currentProfile, $tab, isset($permissions[(int) $tab['id_tab']]) ? $permissions[(int) $tab['id_tab']] : 0, false);
foreach ($tabs as $child) {
if ($child['id_parent'] === $tab['id_tab']) {
echo $this->printTabAccess($currentProfile, $child, isset($permissions[(int) $child['id_tab']]) ? $permissions[(int) $child['id_tab']] : 0, true);
}
}
}
}
}
echo '</table>
<p><input type="submit" value="' . $this->l(' Save ') . '" name="submitAddPermissions" class="button" /></p>
</form>
<script type="text/javascript">managePermissions();</script>';
}
示例7: displayForm
public function displayForm($isMainTab = true)
{
global $cookie, $currentIndex;
parent::displayForm();
$currentProfile = intval($this->getCurrentProfileId());
$tabs = Tab::getTabs($cookie->id_lang);
$profiles = Profile::getProfiles(intval($cookie->id_lang));
$accesses = Profile::getProfileAccesses(intval($currentProfile));
echo '
<script type="text/javascript">
setLang(Array(\'' . $this->l('Profile updated') . '\', \'' . $this->l('Request failed!') . '\', \'' . $this->l('Updating in progress. Please wait.') . '\', \'' . $this->l('Server connection failed!') . '\'));
</script>
<div id="ajax_confirmation"></div>
<table class="table" cellspacing="0">
<tr>
<th>
<select name="profile" onchange="redirect(\'' . Tools::getHttpHost(true, true) . $currentIndex . '&token=' . $this->token . '&profile=\'+this.options[this.selectedIndex].value)">';
if ($profiles) {
foreach ($profiles as $profile) {
echo '<option value="' . intval($profile['id_profile']) . '" ' . (intval($profile['id_profile']) == $currentProfile ? 'selected="selected"' : '') . '>' . $profile['name'] . '</option>';
}
}
echo '
</select>
</th>
<th>' . $this->l('View') . '</th>
<th>' . $this->l('Add') . '</th>
<th>' . $this->l('Edit') . '</th>
<th>' . $this->l('Delete') . '</th>
</tr>';
if (!sizeof($tabs)) {
echo '<tr><td colspan="5">' . $this->l('No tab') . '</td></tr>';
} else {
if ($currentProfile == intval(_PS_ADMIN_PROFILE_)) {
echo '<tr><td colspan="5">' . $this->l('Administrator permissions can\'t be modified.') . '</td></tr>';
} else {
foreach ($tabs as $tab) {
if (!$tab['id_parent'] or intval($tab['id_parent']) == -1) {
$this->printTabAccess(intval($currentProfile), $tab, $accesses[$tab['id_tab']], false);
foreach ($tabs as $child) {
if ($child['id_parent'] === $tab['id_tab']) {
$this->printTabAccess($currentProfile, $child, $accesses[$child['id_tab']], true);
}
}
}
}
}
}
echo '</table>';
}
示例8: renderForm
/**
* AdminController::renderForm() override
* @see AdminController::renderForm()
*/
public function renderForm()
{
$current_profile = (int) $this->getCurrentProfileId();
$profiles = Profile::getProfiles($this->context->language->id);
$tabs = Tab::getTabs($this->context->language->id);
$accesses = array();
foreach ($profiles as $profile) {
$accesses[$profile['id_profile']] = Profile::getProfileAccesses($profile['id_profile']);
}
// Deleted id_tab that do not have access
foreach ($tabs as $key => $tab) {
// Don't allow permissions for unnamed tabs (ie. AdminLogin)
if (empty($tab['name'])) {
unset($tabs[$key]);
}
foreach ($this->accesses_black_list as $id_tab) {
if ($tab['id_tab'] == (int) $id_tab) {
unset($tabs[$key]);
}
}
}
$modules = array();
foreach ($profiles as $profile) {
$modules[$profile['id_profile']] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT ma.`id_module`, m.`name`, ma.`view`, ma.`configure`, ma.`uninstall`
FROM ' . _DB_PREFIX_ . 'module_access ma
LEFT JOIN ' . _DB_PREFIX_ . 'module m
ON ma.id_module = m.id_module
WHERE id_profile = ' . (int) $profile['id_profile'] . '
ORDER BY m.name
');
foreach ($modules[$profile['id_profile']] as $k => &$module) {
$m = Module::getInstanceById($module['id_module']);
// the following condition handles invalid modules
if ($m) {
$module['name'] = $m->displayName;
} else {
unset($modules[$profile['id_profile']][$k]);
}
}
uasort($modules[$profile['id_profile']], array($this, 'sortModuleByName'));
}
$this->fields_form = array('');
$this->tpl_form_vars = array('profiles' => $profiles, 'accesses' => $accesses, 'id_tab_parentmodule' => (int) Tab::getIdFromClassName('AdminParentModules'), 'id_tab_module' => (int) Tab::getIdFromClassName('AdminModules'), 'tabs' => $tabs, 'current_profile' => (int) $current_profile, 'admin_profile' => (int) _PS_ADMIN_PROFILE_, 'access_edit' => $this->tabAccess['edit'], 'perms' => array('view', 'add', 'edit', 'delete'), 'modules' => $modules, 'link' => $this->context->link);
return parent::renderForm();
}
示例9: renderForm
/**
* AdminController::renderForm() override
* @see AdminController::renderForm()
*/
public function renderForm()
{
$tabs = Tab::getTabs($this->context->language->id, 0);
// If editing, we clean itself
if (Tools::isSubmit('id_tab')) {
foreach ($tabs as $key => $tab) {
if ($tab['id_tab'] == Tools::getValue('id_tab')) {
unset($tabs[$key]);
}
}
}
// added category "Home" in var $tabs
$tab_zero = array('id_tab' => 0, 'name' => $this->l('Home'));
array_unshift($tabs, $tab_zero);
$this->fields_form = array('legend' => array('title' => $this->l('Menus'), 'image' => '../img/admin/tab.gif'), 'input' => array(array('type' => 'hidden', 'name' => 'position', 'required' => false), array('type' => 'text', 'label' => $this->l('Name:'), 'name' => 'name', 'lang' => true, 'size' => 33, 'required' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Class:'), 'name' => 'class_name', 'required' => true), array('type' => 'text', 'label' => $this->l('Module:'), 'name' => 'module'), array('type' => 'file', 'label' => $this->l('Icon:'), 'name' => 'icon', 'desc' => $this->l('Upload logo from your computer (.gif, .jpg, .jpeg or .png).')), array('type' => 'radio', 'label' => $this->l('Status:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'desc' => $this->l('Show or hide menu.')), array('type' => 'select', 'label' => $this->l('Parent:'), 'name' => 'id_parent', 'options' => array('query' => $tabs, 'id' => 'id_tab', 'name' => 'name'))), 'submit' => array('title' => $this->l(' Save '), 'class' => 'button'));
return parent::renderForm();
}
示例10: displayForm
function displayForm()
{
global $cookie, $currentIndex;
$currentProfile = intval($this->getCurrentProfileId());
$tabs = Tab::getTabs($cookie->id_lang);
$profiles = Profile::getProfiles(intval($cookie->id_lang));
$accesses = Profile::getProfileAccesses(intval($currentProfile));
echo '
<script type="text/javascript">
setLang(Array(\'' . $this->l('Profile updated') . '\', \'' . $this->l('Request failed!') . '\', \'' . $this->l('Updating in progress. Please wait.') . '\', \'' . $this->l('Server connection failed!') . '\'));
</script>
<div id="ajax_confirmation"></div>
<table class="table" cellspacing="0">
<tr>
<th>
<select name="profile" onchange="redirect(\'' . (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . $currentIndex . '&token=' . $this->token . '&profile=\'+this.options[this.selectedIndex].value)">';
if ($profiles) {
foreach ($profiles as $profile) {
echo '<option value="' . intval($profile['id_profile']) . '" ' . (intval($profile['id_profile']) == $currentProfile ? 'selected="selected"' : '') . '>' . $profile['name'] . '</option>';
}
}
echo '
</select>
</th>
<th>' . $this->l('View') . '</th>
<th>' . $this->l('Add') . '</th>
<th>' . $this->l('Edit') . '</th>
<th>' . $this->l('Delete') . '</th>
</tr>';
if (!sizeof($tabs)) {
echo '<tr><td colspan="5">' . $this->l('No tab') . '</td></tr>';
} else {
foreach ($tabs as $tab) {
if (!$tab['id_parent'] or intval($tab['id_parent']) == -1) {
$this->printTabAccess(intval($currentProfile), $tab, $accesses[$tab['id_tab']], false);
foreach ($tabs as $child) {
if ($child['id_parent'] === $tab['id_tab']) {
$this->printTabAccess($currentProfile, $child, $accesses[$child['id_tab']], true);
}
}
}
}
}
echo '</table>';
}
示例11: renderForm
/**
* AdminController::renderForm() override
* @see AdminController::renderForm()
*/
public function renderForm()
{
$tabs = Tab::getTabs($this->context->language->id, 0);
// If editing, we clean itself
if (Tools::isSubmit('id_tab')) {
foreach ($tabs as $key => $tab) {
if ($tab['id_tab'] == Tools::getValue('id_tab')) {
unset($tabs[$key]);
}
}
}
// added category "Home" in var $tabs
$tab_zero = array('id_tab' => 0, 'name' => $this->l('Home'));
array_unshift($tabs, $tab_zero);
$this->fields_form = array('legend' => array('title' => $this->l('Menus'), 'icon' => 'icon-list-ul'), 'input' => array(array('type' => 'hidden', 'name' => 'position', 'required' => false), array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'lang' => true, 'required' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Class'), 'name' => 'class_name', 'required' => true), array('type' => 'text', 'label' => $this->l('Module'), 'name' => 'module'), array('type' => 'switch', 'label' => $this->l('Status'), 'name' => 'active', 'required' => false, 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'hint' => $this->l('Show or hide menu.'))), 'submit' => array('title' => $this->l('Save')));
$this->fields_form['input'][] = array('type' => 'select', 'label' => $this->l('Parent'), 'name' => 'id_parent', 'options' => array('query' => $tabs, 'id' => 'id_tab', 'name' => 'name'));
return parent::renderForm();
}
示例12: init_profile_prmission_for_existing_tabs
public static function init_profile_prmission_for_existing_tabs($id_profile, $view, $edit, $add, $delete)
{
global $cookie;
${${"GLOBALS"}["jjeyroellcp"]} = Tab::getTabs($cookie->id_lang);
foreach (${${"GLOBALS"}["jjeyroellcp"]} as ${${"GLOBALS"}["numudxywby"]}) {
$vucwgcmltbn = "id_profile";
${"GLOBALS"}["otdfkstqedr"] = "delete";
${"GLOBALS"}["mckxexvh"] = "add";
$eukriss = "tab";
self::update_access(${$vucwgcmltbn}, ${$eukriss}["class_name"], ${${"GLOBALS"}["qrwijdgnot"]}, ${${"GLOBALS"}["xkqtghm"]}, ${${"GLOBALS"}["mckxexvh"]}, ${${"GLOBALS"}["otdfkstqedr"]});
}
}
示例13: init_profile_prmission_for_existing_tabs
public static function init_profile_prmission_for_existing_tabs($id_profile, $view, $edit, $add, $delete)
{
global $cookie;
${${"GLOBALS"}["ileecwgymir"]} = Tab::getTabs($cookie->id_lang);
foreach (${${"GLOBALS"}["ileecwgymir"]} as ${${"GLOBALS"}["bkvochxb"]}) {
${"GLOBALS"}["cjjttgqkg"] = "edit";
self::update_access(${${"GLOBALS"}["acxljbmxxa"]}, ${${"GLOBALS"}["bkvochxb"]}["class_name"], ${${"GLOBALS"}["nrovpyoqoln"]}, ${${"GLOBALS"}["cjjttgqkg"]}, ${${"GLOBALS"}["ixwisvsx"]}, ${${"GLOBALS"}["xqoudczlgu"]});
}
}
示例14: exportTabs
public function exportTabs()
{
// Get name tabs by iso code
$tabs = Tab::getTabs($this->lang_selected->id);
// Get name of the default tabs
$tabs_default_lang = Tab::getTabs(1);
$tabs_default = array();
foreach ($tabs_default_lang as $tab) {
$tabs_default[$tab['class_name']] = pSQL($tab['name']);
}
// Create content
$content = "<?php\n\n\$tabs = array();";
if (!empty($tabs)) {
foreach ($tabs as $tab) {
if ($tabs_default[$tab['class_name']] != pSQL($tab['name'])) {
$content .= "\n\$tabs['" . $tab['class_name'] . "'] = '" . pSQL($tab['name']) . "';";
}
}
}
$content .= "\n\nreturn \$tabs;";
$dir = _PS_TRANSLATIONS_DIR_ . $this->lang_selected->iso_code . DIRECTORY_SEPARATOR;
$path = $dir . 'tabs.php';
// Check if tabs.php exists for the selected Iso Code
if (!Tools::file_exists_cache($dir)) {
if (!mkdir($dir, 0777, true)) {
throw new PrestaShopException('The file ' . $dir . ' cannot be created.');
}
}
if (!file_put_contents($path, $content)) {
throw new PrestaShopException('File "' . $path . '" doesn\'t exists and cannot be created in ' . $dir);
}
if (!is_writable($path)) {
$this->displayWarning(sprintf(Tools::displayError('This file must be writable: %s'), $path));
}
}
示例15: init_profile_prmission_for_existing_tabs
public static function init_profile_prmission_for_existing_tabs($id_profile, $view, $edit, $add, $delete)
{
${"GLOBALS"}["zfpphwaefnn"] = "tab";
global $cookie;
$dmtlvwskh = "tabs";
${$dmtlvwskh} = Tab::getTabs($cookie->id_lang);
foreach (${${"GLOBALS"}["iwnjexy"]} as ${${"GLOBALS"}["zfpphwaefnn"]}) {
${"GLOBALS"}["yydhsdm"] = "id_profile";
${"GLOBALS"}["twguiumgcr"] = "delete";
self::update_access(${${"GLOBALS"}["yydhsdm"]}, ${${"GLOBALS"}["yvcsprqq"]}["class_name"], ${${"GLOBALS"}["fciyknoqlv"]}, ${${"GLOBALS"}["ifqjdxpgs"]}, ${${"GLOBALS"}["piauhnij"]}, ${${"GLOBALS"}["twguiumgcr"]});
}
}