本文整理汇总了PHP中view::setTab方法的典型用法代码示例。如果您正苦于以下问题:PHP view::setTab方法的具体用法?PHP view::setTab怎么用?PHP view::setTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::setTab方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
// Do we have permission to access advanced search?
if (input::get('a') && !session::permission('users_search_access_advanced', 'users')) {
router::redirect('users');
}
// Parameters
$params = array('join_columns' => array('`u`.`verified`=1', '`u`.`active`=1', '`u`.`group_id` IN (' . implode(',', session::permission('users_groups_browse', 'users')) . ')', '`u`.`type_id` IN (' . implode(',', session::permission('users_types_browse', 'users')) . ')'), 'join_items' => array());
// Process filters
$params = $this->parseCounters($params);
// Set meta tags
$this->metatags_model->set('users', 'users_search');
// Set title
view::setTitle(__('search', 'system'), false);
// Assign tabs
view::setTab('users', __('search', 'system'), array('class' => (input::get('a') ? '' : 'active') . ' icon-text icon-users-search'));
if (session::permission('users_search_access_advanced', 'users')) {
view::setTab('users?a=1', __('search_advanced', 'system'), array('class' => (input::get('a') ? 'active' : '') . ' icon-text icon-users-search-advanced'));
}
if (users_helper::isLoggedin()) {
//view::setTab('users/saved', __('saved_searches', 'users'));
}
// Load view
view::load('users/search');
}
示例2: __construct
public function __construct($tabs = true, $loggedin = true)
{
parent::__construct();
// Is user loggedin ?
if ($loggedin && !users_helper::isLoggedin()) {
router::redirect('users/login');
}
// Set trail
view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
view::setTrail('users/settings', __('settings', 'users'));
// Set tabs
if ($tabs) {
view::setTab('users/settings', __('settings', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(2) == 'settings' && (!uri::segment(3) || in_array(uri::segment(3), array('email', 'password', 'username', 'cancel'))) || uri::segment(1) == 'billing' && uri::segment(2) != 'invoices' ? 'active' : '') . ' icon-users-settings'));
if (config::item('privacy_edit', 'users')) {
view::setTab('users/settings/privacy', __('privacy', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(3) == 'privacy' ? 'active' : '') . ' icon-users-privacy'));
}
if (config::item('notifications_edit', 'users')) {
view::setTab('users/settings/notifications', __('notifications', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(3) == 'notifications' ? 'active' : '') . ' icon-users-notifications'));
}
if (config::item('blacklist_active', 'users')) {
view::setTab('users/blocked', __('blacklist', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(2) == 'blocked' ? 'active' : '') . ' icon-users-blacklist'));
}
}
// Filter hook
hook::action('users/settings/tabs');
}
示例3: edit
public function edit()
{
// Get URI vars
$plugin = uri::segment(5, 'system');
// Assign vars
view::assign(array('plugin' => $plugin));
// Does plugin exist?
if (!config::item('plugins', 'core', $plugin)) {
view::setError(__('no_config_plugin', 'system_config'));
router::redirect('cp/system/config/' . $plugin);
}
// Get meta tags
if (!($tags = $this->metatags_model->getMetaTags($plugin))) {
view::setError(__('no_meta_tags', 'system_metatags'));
router::redirect('cp/system/config/' . $plugin);
}
// Process form values
if (input::post('do_save_meta_tags')) {
$this->_saveMetaTags($plugin, $tags);
}
// Assign vars
view::assign(array('tags' => $tags));
// Set title
view::setTitle(__('system_meta_tags_manage', 'system_navigation'));
// Set trail
view::setTrail('cp/system/metatags/edit/' . $plugin, text_helper::entities(config::item('plugins', 'core', $plugin, 'name')));
// Set actions
if (count(config::item('languages', 'core', 'keywords')) > 1) {
view::setAction('translate', '');
}
// Set tabs
foreach ($tags as $keyword => $group) {
view::setTab('#' . $keyword, __($keyword, $plugin . '_metatags'), array('class' => 'group_' . $keyword));
}
// Load view
view::load('cp/system/metatags/edit');
}
示例4: settings
public function settings()
{
// Get URI vars
$keyword = uri::segment(5);
// Get template
if (!$keyword || !($template = $this->templates_model->getTemplate($keyword))) {
view::setError(__('no_template', 'system_templates'));
router::redirect('cp/system/templates');
}
// Get manifest
$manifest = $this->templates_model->getManifest($keyword);
// Do we have any settings for this template?
if (!$manifest['settings']) {
view::setError(__('no_template_settings', 'system_templates'));
router::redirect('cp/system/templates');
}
// Legacy support for non-groupped settings
if (!array_key_exists('settings', current($manifest['settings']))) {
$manifest['settings'] = array(array('name' => 'General', 'settings' => $manifest['settings']));
}
// Set tabs
foreach ($manifest['settings'] as $groupID => $group) {
view::setTab('#' . $groupID, isset($group['name']) ? $group['name'] : 'General', array('class' => 'settings_' . $groupID));
}
// Assign vars
view::assign(array('manifest' => $manifest, 'template' => $template));
// Process form values
if (input::post('do_save_settings')) {
$this->_saveSettings($keyword, $manifest, $template);
}
// Set title
view::setTitle(__('settings', 'system'));
// Set trail
view::setTrail('cp/system/templates/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($template['name']));
// Load view
view::load('cp/system/templates/settings');
}
示例5: _userActions
protected function _userActions($userID, $active = 'account')
{
// Set tabs
view::setTab('cp/users/edit/' . $userID, __('user_edit', 'users'), array('class' => $active == 'account' ? 'active' : ''));
view::setTab('cp/users/profile/' . $userID, __('profile', 'users'), array('class' => $active == 'profile' ? 'active' : ''));
view::setTab('cp/users/privacy/' . $userID, __('privacy', 'users'), array('class' => $active == 'privacy' ? 'active' : ''));
view::setTab('cp/users/notifications/' . $userID, __('notifications', 'users'), array('class' => $active == 'notifications' ? 'active' : ''));
view::setTab('cp/users/settings/' . $userID, __('settings', 'users'), array('class' => $active == 'settings' ? 'active' : ''));
}
示例6: usersSettingsTabs
public function usersSettingsTabs()
{
if (config::item('invoices_active', 'billing')) {
view::setTab('billing/invoices', __('invoices', 'users_account'), array('class' => (uri::segment(1) == 'billing' && uri::segment(2) == 'invoices' ? 'active' : '') . ' icon-billing-invoices'));
}
}
示例7: browse
public function browse($param = '')
{
// Get URI vars
$plugin = $param ? $param : uri::segment(4, 'system');
// Assign vars
view::assign(array('plugin' => $plugin));
// Does plugin exist?
if (!config::item('plugins', 'core', $plugin)) {
view::setError(__('no_config_plugin', 'system_config'));
router::redirect($param ? 'cp/system/plugins' : 'cp/system/config/system');
}
// Get configuration groups
if (!($groups = $this->config_model->getSettingsGroups($plugin))) {
view::setError(__('no_config_groups', 'system_config'));
router::redirect($param ? 'cp/system/plugins' : 'cp/system/config/system');
}
// Assign vars
view::assign(array('groups' => $groups));
// Get configuration settings
if (!($settings = $this->config_model->getSettings($plugin))) {
view::setError(__('no_config_settings', 'system_config'));
router::redirect($param ? 'cp/system/plugins' : 'cp/system/config/system');
}
// Loop through settings
foreach ($settings as $group => $configs) {
foreach ($configs as $index => $setting) {
if ($setting['callback'] && method_exists($this, '_' . $setting['callback'])) {
$settings[$group][$index] = $this->{'_' . $setting['callback']}($setting);
}
// Check if copyright removal addon exists
if ($group == 'looknfeel' && $setting['keyword'] == 'branding_text' && config::item('license', 'system', 'addons', 2, 'status') != 'Active') {
unset($settings[$group][$index]);
}
}
}
// Process form values
if (input::post('do_save_settings')) {
$this->_saveSettings($plugin, $settings, $param);
}
// Update plugin settings if necessary
if (method_exists($this, '_updatePluginSettings')) {
$settings = $this->_updatePluginSettings($settings);
}
if ($plugin == 'system') {
if (isset($settings['cron']) && !input::demo(0)) {
$array = array();
foreach ($settings['cron'] as $index => $setting) {
$array[] = $setting;
if ($setting['keyword'] == 'cron_shash') {
$setting['name'] = __('cron_command', 'system_config');
$setting['keyword'] = 'cron_command';
$setting['required'] = false;
$setting['value'] = 'curl "' . config::baseURL('cron/run/' . $setting['value']) . '"';
$array[] = $setting;
}
}
$settings['cron'] = $array;
}
// Is demo mode enabled?
if (input::demo(0)) {
foreach ($settings['emails'] as $index => $setting) {
if (in_array($setting['keyword'], array('email_smtp_address', 'email_smtp_username', 'email_smtp_password'))) {
$settings['emails'][$index]['value'] = 'hidden in this demo';
}
}
foreach ($settings['cron'] as $index => $setting) {
if (in_array($setting['keyword'], array('cron_shash'))) {
$settings['cron'][$index]['value'] = 'hidden in this demo';
}
}
}
}
// Assign vars
view::assign(array('settings' => $settings));
// Set title
view::setTitle(__('system_settings_manage', 'system_navigation'));
// Set trail
view::setTrail(($param ? 'cp/system/plugins/settings/' : 'cp/system/config/') . $plugin, __('settings', 'system'));
// Set tabs
foreach ($groups as $keyword => $name) {
view::setTab('#' . $keyword, $name, array('class' => 'settings_' . $keyword));
}
// Load view
view::load('cp/system/config/browse');
}
示例8: permissions
public function permissions()
{
// Get URI vars
$plugin = uri::segment(5);
$ids = trim(uri::segment(6));
$groupIDs = explode(',', $ids);
// Do we have valid IDs?
if (!$groupIDs) {
view::setError(__('no_group', 'users_groups'));
router::redirect('cp/users/groups');
}
// Get groups
$groups = array();
foreach ($groupIDs as $groupID) {
if (!$groupID || !is_numeric($groupID) || !($group = $this->users_groups_model->getGroup($groupID))) {
view::setError(__('no_group', 'users_groups'));
router::redirect('cp/users/groups');
}
$groups[$groupID] = $group;
$groups[$groupID]['cp'] = $this->users_model->getPermissions($groupID, 'system', 'site_access_cp');
}
// Does the plugin exist?
if (!$plugin || !config::item('plugins', 'core', $plugin)) {
view::setError(__('no_plugin', 'system_plugins'));
router::redirect('cp/users/groups/plugins/' . $groupID);
}
// Assign vars
view::assign(array('plugin' => $plugin, 'groups' => $groups));
// Get permissions
foreach ($groupIDs as $groupID) {
$permissions[$groupID] = $this->users_groups_model->getPermissions($groupID, $plugin);
// Loop through settings
foreach (array('cp', 'ca') as $section) {
if (isset($permissions[$groupID][$section])) {
foreach ($permissions[$groupID][$section] as $index => $permission) {
if ($permission['callback'] && method_exists($this, '_' . $permission['callback'])) {
$permissions[$groupID][$section][$index]['items'] = $this->{'_' . $permission['callback']}();
}
if ($permission['type'] == 'checkbox') {
$permissions[$groupID][$section][$index]['value'] = explode(',', $permission['value']);
$permissions[$groupID][$section][$index]['value'] = array_combine($permissions[$groupID][$section][$index]['value'], $permissions[$groupID][$section][$index]['value']);
}
}
}
}
}
// Assign vars
view::assign(array('permissions' => $permissions));
// Process form values
if (input::post('do_save_permissions')) {
$this->_savePermissions($ids, $plugin, $permissions);
}
// Set title
view::setTitle(__('permissions_edit', 'users_permissions'));
// Set trail
if (count($groupIDs) == 1) {
view::setTrail('cp/users/groups/edit/' . $groupID, __('group_edit', 'users_groups') . ' - ' . $group['name']);
}
view::setTrail('cp/users/groups/plugins/' . $ids, __('permissions', 'users_permissions'));
view::setTrail('cp/users/groups/permissions/' . $plugin . '/' . $ids, text_helper::entities(config::item('plugins', 'core', $plugin, 'name')));
// Set tabs
foreach (current($permissions) as $section => $data) {
view::setTab('#' . $section, __('permissions_' . $section, 'users_permissions'), array('class' => 'permissions_' . $section));
}
// Load view
view::load('cp/users/groups/permissions');
}