本文整理汇总了PHP中Profile::getProfiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::getProfiles方法的具体用法?PHP Profile::getProfiles怎么用?PHP Profile::getProfiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::getProfiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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>';
}
示例3: 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>';
}
示例4: displayForm
public function displayForm($isMainTab = true)
{
global $currentIndex, $cookie;
parent::displayForm();
$obj = $this->loadObject(true);
$profiles = Profile::getProfiles(intval($cookie->id_lang));
echo '
<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post" enctype="multipart/form-data" class="width2">
' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
<fieldset><legend><img src="../img/admin/nav-user.gif" />' . $this->l('Employees') . '</legend>
<label>' . $this->l('Last name:') . ' </label>
<div class="margin-form">
<input type="text" size="33" name="lastname" value="' . htmlentities($this->getFieldValue($obj, 'lastname'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
</div>
<label>' . $this->l('First name:') . ' </label>
<div class="margin-form">
<input type="text" size="33" name="firstname" value="' . htmlentities($this->getFieldValue($obj, 'firstname'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
</div>
<label>' . $this->l('Password:') . ' </label>
<div class="margin-form">
<input type="password" size="33" name="passwd" value="" /> <sup>*</sup>
<p>' . ($obj->id ? $this->l('Leave blank if you do not want to change your password') : $this->l('Min. 8 characters; use only letters, numbers or') . ' -_') . '</p>
</div>
<label>' . $this->l('E-mail address:') . ' </label>
<div class="margin-form">
<input type="text" size="33" name="email" value="' . htmlentities($this->getFieldValue($obj, 'email'), ENT_COMPAT, 'UTF-8') . '" /> <sup>*</sup>
</div>
<label>' . $this->l('Status:') . ' </label>
<div class="margin-form">
<input type="radio" name="active" id="active_on" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
<input type="radio" name="active" id="active_off" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
<p>' . $this->l('Allow or disallow this employee to log in to this Back Office') . '</p>
</div>
<label>' . $this->l('Profile:') . ' </label>
<div class="margin-form">
<select name="id_profile">
<option value="">---------</option>';
/* Profile display */
foreach ($profiles as $profile) {
echo '
<option value="' . $profile['id_profile'] . '"' . ($profile['id_profile'] === $this->getFieldValue($obj, 'id_profile') ? ' selected="selected"' : '') . '>' . $profile['name'] . '</option>';
}
echo '</select> <sup>*</sup>
</div>
<div class="margin-form">
<input type="submit" value="' . $this->l(' Save ') . '" name="submitAdd' . $this->table . '" class="button" />
</div>
<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
</fieldset>
</form>';
}
示例5: print_profile_list
public static function print_profile_list()
{
$configuration = PS_CLI_CONFIGURE::getConfigurationInstance();
$profiles = Profile::getProfiles($configuration->lang);
$table = new cli\Table();
$table->setHeaders(array('ID', 'Name'));
foreach ($profiles as $profile) {
$table->addRow(array($profile['id_profile'], $profile['name']));
}
$table->display();
return true;
}
示例6: createAdminTabs
private function createAdminTabs()
{
$langs = Language::getLanguages();
$id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
/* * ** create tab publications *** */
$tab0 = new Tab();
$tab0->class_name = "AdminVideos";
$tab0->module = "myvideo";
$tab0->id_parent = 0;
foreach ($langs as $l) {
$tab0->name[$l['id_lang']] = $this->l('Videos');
}
$tab0->save();
$blog_tab_id = $tab0->id;
$tab1 = new Tab();
$tab1->class_name = "AdminVideoCategory";
$tab1->module = "myvideo";
$tab1->id_parent = $blog_tab_id;
foreach ($langs as $l) {
$tab1->name[$l['id_lang']] = $this->l('Video Categories');
}
$tab1->save();
/* * ** create tab categories *** */
$tab2 = new Tab();
$tab2->class_name = "AdminVideo";
$tab2->module = "myvideo";
$tab2->id_parent = $blog_tab_id;
foreach ($langs as $l) {
$tab2->name[$l['id_lang']] = $this->l('Video');
}
$tab2->save();
/* * * RIGHTS MANAGEMENT ** */
Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'access
WHERE `id_tab` = ' . (int) $tab0->id . '
OR `id_tab` = ' . (int) $tab1->id . '
OR `id_tab` = ' . (int) $tab2->id);
Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'module_access WHERE `id_module` = ' . (int) $this->id);
$profiles = Profile::getProfiles($id_lang);
if (count($profiles)) {
foreach ($profiles as $p) {
Db::getInstance()->Execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . 'access`(`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`)
VALUES (' . $p['id_profile'] . ', ' . (int) $tab0->id . ',1,1,1,1)');
Db::getInstance()->Execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . 'access`(`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`)
VALUES (' . $p['id_profile'] . ', ' . (int) $tab1->id . ',1,1,1,1)');
Db::getInstance()->Execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . 'access`(`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`)
VALUES (' . $p['id_profile'] . ', ' . (int) $tab2->id . ',1,1,1,1)');
Db::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'module_access(`id_profile`, `id_module`, `configure`, `view`)
VALUES (' . $p['id_profile'] . ',' . (int) $this->id . ',1,1)');
}
}
}
示例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: __construct
public function __construct()
{
global $cookie;
$this->table = 'profile';
$this->className = 'Profile';
$this->lang = true;
$this->edit = true;
$this->delete = true;
$this->fieldsDisplay = array('id_profile' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 200));
$this->identifier = 'id_profile';
$list_profile = array();
foreach (Profile::getProfiles($cookie->id_lang) as $profil) {
$list_profile[] = array('value' => $profil['id_profile'], 'name' => $profil['name']);
}
parent::__construct();
}
示例9: 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();
}
示例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: __construct
public function __construct()
{
$this->context = Context::getContext();
$this->table = 'profile';
$this->className = 'Profile';
$this->multishop_context = Shop::CONTEXT_ALL;
$this->lang = true;
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->addRowActionSkipList('delete', array(1));
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array('id_profile' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name')));
$this->identifier = 'id_profile';
$this->fields_form = array('legend' => array('title' => $this->l('Profile'), 'image' => '../img/admin/profiles.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name:'), 'name' => 'name', 'size' => 33, 'required' => true, 'lang' => true)), 'submit' => array('title' => $this->l('Save '), 'class' => 'button'));
$list_profile = array();
foreach (Profile::getProfiles($this->context->language->id) as $profil) {
$list_profile[] = array('value' => $profil['id_profile'], 'name' => $profil['name']);
}
parent::__construct();
}
示例12: baseInit
public function baseInit()
{
$groups = new Group();
$group = $groups->getGroups();
$profiles = new Profile();
$profile = $profiles->getProfiles();
foreach ($group as $single_group) {
$group_arr[$single_group['id']] = $single_group['id'] . ' ' . $single_group['group_name'];
}
$this->addElement('Select', 'id_group', array('required' => false, 'label' => 'Assign to group:', 'MultiOptions' => $this->addClearStart($group_arr)));
$resources = new LinkResource();
$resource = $resources->getLinkResources();
foreach ($resource as $single_resource) {
$resource_arr[$single_resource['id']] = $single_resource['controller'] . ' ' . $single_resource['action'];
}
asort($resource_arr);
$this->addElement('Select', 'id_resource', array('required' => false, 'label' => 'Assign link resource:', 'MultiOptions' => $this->addClearStart($resource_arr)));
$this->submit();
$this->cancel();
}
示例13: __construct
public function __construct()
{
$this->bootstrap = true;
$this->context = Context::getContext();
$this->table = 'profile';
$this->className = 'Profile';
$this->multishop_context = Shop::CONTEXT_ALL;
$this->lang = true;
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->addRowActionSkipList('delete', array(1));
parent::__construct();
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
$this->fields_list = array('id_profile' => array('title' => $this->trans('ID', array(), 'Admin.Global'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->trans('Name', array(), 'Admin.Global')));
$this->identifier = 'id_profile';
$this->fields_form = array('legend' => array('title' => $this->l('Profile'), 'icon' => 'icon-group'), 'input' => array(array('type' => 'text', 'label' => $this->trans('Name', array(), 'Admin.Global'), 'name' => 'name', 'required' => true, 'lang' => true)), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions')));
$list_profile = array();
foreach (Profile::getProfiles($this->context->language->id) as $profil) {
$list_profile[] = array('value' => $profil['id_profile'], 'name' => $profil['name']);
}
}
示例14: init_tab_prmission_for_existing_profiles
public static function init_tab_prmission_for_existing_profiles($className, $view, $edit, $add, $delete)
{
global $cookie;
${${"GLOBALS"}["zkmomcrvsm"]} = Profile::getProfiles($cookie->id_lang);
${${"GLOBALS"}["jblygsl"]} = (int) Configuration::get("AGILE_MS_PROFILE_ID");
foreach (${${"GLOBALS"}["zkmomcrvsm"]} as ${${"GLOBALS"}["nhhrclrvgrj"]}) {
$lhvpuk = "add";
${"GLOBALS"}["grtbrbudoqu"] = "edit";
if (${${"GLOBALS"}["nhhrclrvgrj"]}["id_profile"] == ${${"GLOBALS"}["jblygsl"]}) {
continue;
}
${"GLOBALS"}["mbtmuncpzf"] = "delete";
self::update_access((int) ${${"GLOBALS"}["nhhrclrvgrj"]}["id_profile"], ${${"GLOBALS"}["diutbrwqqpqk"]}, ${${"GLOBALS"}["nrovpyoqoln"]}, ${${"GLOBALS"}["grtbrbudoqu"]}, ${$lhvpuk}, ${${"GLOBALS"}["mbtmuncpzf"]});
}
}
示例15: init_tab_prmission_for_existing_profiles
public static function init_tab_prmission_for_existing_profiles($className, $view, $edit, $add, $delete)
{
global $cookie;
${"GLOBALS"}["djxecd"] = "id_ams";
${${"GLOBALS"}["fwcnmhxwa"]} = Profile::getProfiles($cookie->id_lang);
${"GLOBALS"}["ailocd"] = "profile";
${${"GLOBALS"}["djxecd"]} = (int) Configuration::get("AGILE_MS_PROFILE_ID");
foreach (${${"GLOBALS"}["fwcnmhxwa"]} as ${${"GLOBALS"}["ailocd"]}) {
$jfwlxiaxopmn = "id_ams";
${"GLOBALS"}["ywmlojdahda"] = "delete";
$vhqvolpk = "edit";
$sjcgnjrvw = "add";
${"GLOBALS"}["wgbobhy"] = "profile";
if (${${"GLOBALS"}["wgbobhy"]}["id_profile"] == ${$jfwlxiaxopmn}) {
continue;
}
self::update_access((int) ${${"GLOBALS"}["nlnrowljdvsj"]}["id_profile"], ${${"GLOBALS"}["imkysutx"]}, ${${"GLOBALS"}["fciyknoqlv"]}, ${$vhqvolpk}, ${$sjcgnjrvw}, ${${"GLOBALS"}["ywmlojdahda"]});
}
}