• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_access函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中user_access函数的典型用法代码示例。如果您正苦于以下问题:PHP user_access函数的具体用法?PHP user_access怎么用?PHP user_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了user_access函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: createUser

 /**
  * Function to create a user in Drupal.
  *
  * @param array  $params associated array
  * @param string $mail email id for cms user
  *
  * @return uid if user exists, false otherwise
  *
  * @access public
  *
  */
 function createUser(&$params, $mail)
 {
     $form_state = array();
     $form_state['input'] = array('name' => $params['cms_name'], 'mail' => $params[$mail], 'op' => 'Create new account');
     $admin = user_access('administer users');
     if (!variable_get('user_email_verification', TRUE) || $admin) {
         $form_state['input']['pass'] = array('pass1' => $params['cms_pass'], 'pass2' => $params['cms_pass']);
     }
     $form_state['rebuild'] = FALSE;
     $form_state['programmed'] = TRUE;
     $form_state['method'] = 'post';
     $form_state['build_info']['args'] = array();
     $config = CRM_Core_Config::singleton();
     // we also need to redirect b
     $config->inCiviCRM = TRUE;
     $form = drupal_retrieve_form('user_register_form', $form_state);
     $form_state['process_input'] = 1;
     $form_state['submitted'] = 1;
     drupal_process_form('user_register_form', $form, $form_state);
     $config->inCiviCRM = FALSE;
     if (form_get_errors()) {
         return FALSE;
     } else {
         return $form_state['user']->uid;
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:37,代码来源:Drupal.php


示例2: hook_twitter_accounts

/**
 * Retrieves what Twitter accounts the given user can post to.
 */
function hook_twitter_accounts($drupal_user, $full_access = FALSE) {
  $accounts = array();
  if (user_access('use global twitter account') &&
      ($name = variable_get('twitter_global_name', NULL)) &&
      ($pass = variable_get('twitter_global_password', NULL))) {

    $accounts[$name] = array(
      'screen_name' => $name,
      'password' => $pass,
    );
  }

  $sql = " SELECT ta.*, tu.uid, tu.password, tu.import FROM {twitter_user} tu ";
  $sql .= "LEFT JOIN {twitter_account} ta ON (tu.screen_name = ta.screen_name) ";
  $sql .= "WHERE tu.uid = %d";

  if ($full_access) {
    $sql .= " AND tu.password IS NOT NULL";
  }
  $args = array($drupal_user->uid);
  $results = db_query($sql, $args);

  while ($account = db_fetch_array($results)) {
    $accounts[$account['screen_name']] = $account;
  }
  return $accounts;
}
开发者ID:ATouhou,项目名称:www.alim.org,代码行数:30,代码来源:twitter.api.php


示例3: hook_admin_menu_output_alter

/**
 * Alter content in Administration menu bar before it is rendered.
 *
 * @param $content
 *   A structured array suitable for drupal_render(), at the very least
 *   containing the keys 'menu' and 'links'.  Most implementations likely want
 *   to alter or add to 'links'.
 *
 * $content['menu'] contains the HTML representation of the 'admin_menu' menu
 * tree.
 * @see admin_menu_menu_alter()
 *
 * $content['links'] contains additional top-level links in the Administration
 * menu, such as the icon menu or the logout link. You can add more items here
 * or play with the #weight attribute to customize them.
 * @see theme_admin_menu_links()
 * @see admin_menu_links_icon()
 * @see admin_menu_links_user()
 */
function hook_admin_menu_output_alter(&$content)
{
    // Add new top-level item.
    $content['menu']['myitem'] = array('#title' => t('My item'), '#attributes' => array('class' => array('mymodule-myitem')), '#href' => 'mymodule/path', '#options' => array('query' => drupal_get_destination()), '#weight' => 50);
    // Add link to manually run cron.
    $content['menu']['myitem']['cron'] = array('#title' => t('Run cron'), '#access' => user_access('administer site configuration'), '#href' => 'admin/reports/status/run-cron');
}
开发者ID:nagwani,项目名称:debugging_example,代码行数:26,代码来源:admin_menu.api.php


示例4: quickdrupal_username

/**
 * Override theme_username() function.
 * Removes the text '(not verified)' for anonymous users.
 */
function quickdrupal_username($object)
{
    if ($object->uid && $object->name) {
        if (drupal_strlen($object->name) > 20) {
            $name = drupal_substr($object->name, 0, 15) . '...';
        } else {
            $name = $object->name;
        }
        if (user_access('access user profiles')) {
            $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'))));
        } else {
            $output = check_plain($name);
        }
    } else {
        if ($object->name) {
            if (!empty($object->homepage)) {
                $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));
            } else {
                $output = check_plain($object->name);
            }
        } else {
            $output = check_plain(variable_get('anonymous', t('Anonymous')));
        }
    }
    return $output;
}
开发者ID:jpshayes,项目名称:quickdrupal,代码行数:30,代码来源:template.php


示例5: gavias_laikafood_preprocess_html

/**
 * Override or insert variables into the html template.
 * @param $vars
 *   An array of variables to pass to the theme template.
 */
function gavias_laikafood_preprocess_html(&$vars)
{
    global $theme, $base_url;
    global $parent_root;
    $skin = theme_get_setting('theme_skin');
    drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/css/' . ($skin ? 'skins/' . $skin . '/' : '') . 'template.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/css/' . ($skin ? 'skins/' . $skin . '/' : '') . 'bootstrap.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    if (module_exists('gavias_themer') && theme_get_setting('frontend_panel') == '1' && user_access('gavias_customize_preview')) {
        gavias_load_fontend();
    }
    if (theme_get_setting('enable_custom_style') == 1 && trim(variable_get('gavias_profile'))) {
        drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/customize/save/' . variable_get('gavias_profile') . '.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    }
    $viewport = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, maximum-scale=1'), '#weight' => 1);
    drupal_add_html_head($viewport, 'viewport');
    // Add boxed class if layout is set that way.
    if (theme_get_setting('site_layout') == 'boxed') {
        $vars['classes_array'][] = 'boxed';
    }
    if (theme_get_setting('preloader') == '1') {
        $vars['classes_array'][] = 'js-preloader';
    } else {
        $vars['classes_array'][] = 'not-preloader';
    }
}
开发者ID:ucaka,项目名称:forestway,代码行数:30,代码来源:template.php


示例6: phptemplate_username

function phptemplate_username($object)
{
    if ($object->uid && $object->name) {
        // Shorten the name when it is too long or it will break many tables.
        if (arg(0) == 'user' or 'groups') {
            $name = $object->name;
        } else {
            if (drupal_strlen($object->name) > 20) {
                $name = drupal_substr($object->name, 0, 15) . '...';
            } else {
                $name = $object->name;
            }
        }
        if (user_access('access user profiles')) {
            $output = l($name, 'user/' . $object->uid, array('title' => t('View user profile.')));
        } else {
            $output = check_plain($name);
        }
    } else {
        if ($object->name) {
            // Sometimes modules display content composed by people who are
            // not registered members of the site (e.g. mailing list or news
            // aggregator modules). This clause enables modules to display
            // the true author of the content.
            if ($object->homepage) {
                $output = l($object->name, $object->homepage, array('class' => 'anonymous', 'title' => t('not verified')));
            } else {
                $output = '<span class="anonymous" title="' . t('not verified') . '">' . check_plain($object->name) . '</span>';
            }
        } else {
            $output = variable_get('anonymous', t('Anonymous'));
        }
    }
    return $output;
}
开发者ID:benced,项目名称:drupal-indymedia-alba,代码行数:35,代码来源:template.php


示例7: getList

 /**
  * Overrides \RestfulEntityBase::getList().
  *
  * Make sure only privileged users may see a list of users.
  */
 public function getList() {
   $account = $this->getAccount();
   if (!user_access('administer users', $account) && !user_access('access user profiles', $account)) {
     throw new \RestfulForbiddenException('You do not have access to listing of users.');
   }
   return parent::getList();
 }
开发者ID:humanitarianresponse,项目名称:site,代码行数:12,代码来源:RestfulEntityBaseUser.php


示例8: __construct

 /**
  * Default constructor.
  *
  * @param null|int $id
  *   Comment id if a comment edit form is to be loaded and null if comment
  *   add form is to be loaded.
  */
 public function __construct($id)
 {
     if (!user_access('post comments')) {
         $this->setErrors("User is not allowed to post comments.");
         $this->setInitialized(FALSE);
         return;
     }
     $args = func_get_args();
     array_shift($args);
     $nid = array_shift($args);
     $pid = array_shift($args);
     $classname = get_called_class();
     $class = new \ReflectionClass($classname);
     $class_shortname = $class->getShortName();
     $class_fullname = "RedTest\\entities\\Comment\\" . substr($class_shortname, 0, -4);
     $commentObject = new $class_fullname($id, $nid, $pid);
     if (!$commentObject->getInitialized()) {
         $this->setErrors($commentObject->getErrors());
         $this->setInitialized(FALSE);
         return;
     }
     $this->setEntityObject($commentObject);
     $nid = $commentObject->getNidValues();
     $node = node_load($nid);
     if ($node->comment != COMMENT_NODE_OPEN && is_null($id)) {
         $this->setErrors("Node {$nid} does not allow posting of comments.");
         $this->setInitialized(FALSE);
         return;
     }
     $type = Utils::makeSnakeCase(substr($class_shortname, 0, -11));
     parent::__construct('comment_node_' . $type . '_form', (object) array('nid' => $nid, 'pid' => $pid));
 }
开发者ID:redcrackle,项目名称:redtest-core,代码行数:39,代码来源:CommentForm.php


示例9: cubert_preprocess_views_view_table

function cubert_preprocess_views_view_table(&$vars)
{
    // Table headers are collapsible by default - override that for specific views here.
    $no_collapse = array('tickets_feature_requests', 'tickets_bug_reports');
    if (!in_array($vars['view']->name, $no_collapse)) {
        $vars['collapsible_title'] = TRUE;
    }
    $extra_classes = '';
    // Add "Completed" value for milestones
    if ($vars['view']->name == 'milestones') {
        $can_edit = user_access('administer milestones');
        $vars['can_edit'] = $can_edit;
        $key = key($vars['result']);
        $nid = !empty($vars['result'][$key]->nid) ? $vars['result'][$key]->nid : '';
        if (!empty($nid)) {
            $node = node_load($nid);
            $completed = !empty($node->field_milestone_completed[LANGUAGE_NONE][0]['value']) ? $node->field_milestone_completed[LANGUAGE_NONE][0]['value'] : FALSE;
            $vars['milestone_completed'] = $completed;
            if ($completed) {
                $vars['completed_class'] = 'completed';
            } else {
                $vars['completed_class'] = 'uncompleted';
            }
            $vars['nid'] = $nid;
            $extra_classes = ' collapse';
        }
    }
    $vars['extra_classes'] = $extra_classes;
}
开发者ID:signaltrace-dev,项目名称:cubert-theme,代码行数:29,代码来源:table.vars.php


示例10: thearchivetheme_process_page

function thearchivetheme_process_page(&$vars)
{
    $usernav = '';
    if (user_is_logged_in()) {
        global $user;
        $node = menu_get_object();
        $ar = array();
        if ($node) {
            $nid = $node->nid;
            if (user_access('update collection')) {
                $ar[] = '<a href="collection/edit/' . $nid . '">編輯</a>';
            }
            if (user_access('update collection')) {
                $ar[] = '<a href="collection/update/file/' . $nid . '">更新數位檔</a>';
            }
            if (user_access('update collection') && editcol_is_video_collection($nid)) {
                $ar[] = '<a href="collection/upload/video_icons/' . $nid . '">自定影片圖示</a>';
            }
            if (user_access('delete collection')) {
                $ar[] = '<a href="collection/delete/' . $nid . '">刪除</a>';
            }
        }
        if (user_access('control panel')) {
            $ar[] = '<a href="/control_panel/1">Control Panel</a>';
        }
        $ar[] = 'Login as ' . $user->name;
        $ar[] = '<a href="/user/logout">Log out</a>';
        $usernav = '<div class="row">' . implode(' | ', $ar) . '</div>';
    }
    $vars['usernav'] = $usernav;
}
开发者ID:318io,项目名称:318-io,代码行数:31,代码来源:template.php


示例11: _maximenu_menu_options

/**
 * Loads options to Maximenu admin
 *
 */
function _maximenu_menu_options($menu_content = array(), $settings = array())
{
    $form_new = array();
    // Skin
    $output_options = isset($settings['outputs']) ? $settings['outputs'] : '';
    if (!empty($output_options)) {
        $form_new['stacking'] = array('#type' => 'select', '#title' => t('Stacking'), '#options' => array('row' => 'Row', 'column' => 'Column'), '#default_value' => isset($menu_content['stacking']) ? $menu_content['stacking'] : 'row', '#description' => t('
        <ul>
          <li><strong>Row</strong> - all links in 1 row</li>
          <li><strong>Column</strong> -all links in 1 column</li>
        </ul>
       '));
        $form_new['direction'] = array('#type' => 'select', '#title' => t('Block Menu Direction'), '#options' => array('block-down' => 'Dropdown', 'block-up' => 'Dropup', 'block-right' => 'Right', 'block-left' => 'Left'), '#default_value' => isset($menu_content['direction']) ? $menu_content['direction'] : 'block-down', '#description' => t('OM Maximenu will popup on this direction. Applicable only with dropdown style.'));
        $access = user_access('use PHP for settings');
        if (isset($menu_content['visibility']) && $menu_content['visibility'] == 2 && !$access) {
            $form_new['visibility'] = array('#type' => 'value', '#value' => 2);
            $form_new['pages'] = array('#type' => 'value', '#value' => $menu_content['pages']);
        } else {
            $options = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
            $description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcardfor every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
            if (module_exists('php') && $access) {
                $options[] = t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
                $description .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code canbreak your Drupal site.', array('%php' => '<?php ?>'));
            }
            $form_new['visibility'] = array('#type' => 'radios', '#title' => t('Show menu on specific pages'), '#options' => $options, '#default_value' => isset($menu_content['visibility']) ? $menu_content['visibility'] : 0);
            $form_new['pages'] = array('#type' => 'textarea', '#title' => t('Pages'), '#default_value' => isset($menu_content['pages']) ? $menu_content['pages'] : '', '#description' => $description);
        }
    }
    return $form_new;
}
开发者ID:ph3l1x,项目名称:mydea,代码行数:34,代码来源:menu.options.php


示例12: mooc_foundation_access_preprocess_page

/**
 * Implements template_preprocess_page.
 */
function mooc_foundation_access_preprocess_page(&$variables)
{
    // speedreader is enabled
    if (module_exists('speedreader')) {
        $variables['speedreader'] = TRUE;
    }
    // mespeak is enabled
    if (module_exists('mespeak')) {
        $variables['mespeak'] = TRUE;
    }
    // support for add child page shortcut
    $node = menu_get_object();
    if ($node && user_access('access printer-friendly version')) {
        $variables['tabs_extras'][200][] = '<hr>';
        $variables['tabs_extras'][200][] = l(t('Print'), 'book/export/html/' . arg(1));
    }
    $child_type = variable_get('book_child_type', 'book');
    if ($node && !empty($node->book) && (user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && isset($node->book['depth']) && $node->book['depth'] < MENU_MAX_DEPTH) {
        $variables['tabs_extras'][200][] = '<hr>';
        $variables['tabs_extras'][200][] = l(t('Add child page'), 'node/add/' . str_replace('_', '-', $child_type), array('query' => array('parent' => $node->book['mlid'])));
    }
    if (user_access('access contextual links')) {
        $variables['tabs_extras'][0][] = '<li class="cis_accessibility_check"></li>';
    }
    // remove the prefix that provides a link to the home page
    // as MOOC is the thing that currently provides support directly for this
    // and slightly overrides the behavior
    $keys = array_keys($variables['page']['header']);
    $keyname = array_shift($keys);
    unset($variables['page']['header'][$keyname]['#prefix']);
}
开发者ID:ronaldmulero,项目名称:elmsln,代码行数:34,代码来源:template.php


示例13: borg_preprocess_page

/**
 * Prepares variables for page.tpl.php
 */
function borg_preprocess_page(&$variables)
{
    // Add the Source Sans Pro font.
    backdrop_add_css('https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700', array('type' => 'external'));
    // Add FontAwesome.
    backdrop_add_js('https://use.fontawesome.com/baf3c35582.js', array('type' => 'external'));
    // Add Flexslider to the front page only.
    if (backdrop_is_front_page()) {
        $path = backdrop_get_path('theme', 'borg');
        backdrop_add_css($path . '/css/flexslider.css');
        backdrop_add_js($path . '/js/jquery.flexslider.js');
        $script = "\n\$(window).load(function() {\n  \$('.flexslider').flexslider();\n});";
        backdrop_add_js($script, array('type' => 'inline'));
    }
    $node = menu_get_object();
    if (isset($node) && isset($node->type) && $node->type === 'book') {
        $variables['classes'][] = 'drawer-open';
        $variables['classes'][] = 'layout-both-sidebars';
    } else {
        $variables['classes'][] = 'drawer-closed';
        $array_key = array_search('layout-both-sidebars', $variables['classes']);
        if ($array_key !== FALSE) {
            $variables['classes'][$array_key] = 'layout-one-sidebar';
        }
    }
    if (module_exists('admin_bar') && user_access('admin_bar')) {
        $variables['classes'][] = 'admin-bar';
    }
}
开发者ID:serundeputy,项目名称:backdropcms.org,代码行数:32,代码来源:template.php


示例14: createOrUpdateWorkSession

 /**
  * Create a new session or update an open session.
  */
 public function createOrUpdateWorkSession()
 {
     $request = $this->getRequest();
     $account = $this->getAccount();
     if (!user_access('timewatch punch')) {
         throw new RestfulForbiddenException('No punch access.');
     }
     if (empty($request['pincode'])) {
         throw new \RestfulBadRequestException('Pincode is required');
     }
     $uid = timewatch_session_get_uid_by_pincode($request['pincode']);
     if (!$uid) {
         throw new \RestfulBadRequestException('Wrong pincode');
     }
     $employee_account = user_load($uid);
     // Find an existing session with no end date.
     $query = new EntityFieldQuery();
     $result = $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'work_session')->propertyCondition('status', NODE_PUBLISHED)->fieldCondition('field_employee', 'target_id', $uid)->fieldCondition('field_session_date', 'value2', NULL)->range(0, 1)->execute();
     if (empty($result['node'])) {
         // When there's no open session, create a new one.
         $values = array('type' => 'work_session', 'uid' => $account->uid, 'status' => NODE_PUBLISHED, 'title' => format_string('@date - @user', array('@date' => date('d/m/y'), '@user' => $employee_account->name)));
         $node = entity_create('node', $values);
         $wrapper = entity_metadata_wrapper('node', $node);
         $wrapper->field_employee->set($uid);
         $wrapper->field_session_date->value->set(REQUEST_TIME);
     } else {
         // Otherwise set the end date of the open session.
         $wrapper = entity_metadata_wrapper('node', key($result['node']));
         $wrapper->field_session_date->value2->set(REQUEST_TIME);
     }
     $wrapper->save();
     return $this->viewEntity($wrapper->getIdentifier());
 }
开发者ID:Gizra,项目名称:timewatch-server,代码行数:36,代码来源:TimewatchPunchResource.class.php


示例15: _contact_personal_tab_access

/**
 * Menu access callback for a user's personal contact form.
 *
 * @param $account
 *   The user object of the user whose contact form is being requested.
 */
function _contact_personal_tab_access($account)
{
    global $user;
    // Anonymous users cannot have contact forms.
    if (!$account->uid) {
        return FALSE;
    }
    // User administrators should always have access to personal contact forms.
    if (user_access('administer users')) {
        return TRUE;
    }
    // Users may not contact themselves.
    if ($user->uid == $account->uid) {
        return FALSE;
    }
    // If the requested user has disabled their contact form, or this preference
    // has not yet been saved, do not allow users to contact them.
    if (empty($account->data['contact'])) {
        return FALSE;
    }
    // If requested user has been blocked, do not allow users to contact them.
    if (empty($account->status)) {
        return FALSE;
    }
    return user_access('access user contact forms');
}
开发者ID:klaidliadon,项目名称:git-fixture,代码行数:32,代码来源:crappy.php


示例16: openfit_base_preprocess_comment

function openfit_base_preprocess_comment(&$variables)
{
    $openfit_node_types = array('activity' => TRUE);
    if (!isset($variables['node']) || !isset($openfit_node_types[$variables['node']->type])) {
        return;
    }
    $comment = $variables['comment'];
    // Remove the standard comment links: reply, edit, delete
    unset($variables['content']['links']['comment']['#links']);
    // Add a delete menu if the user posted the comment or is admin
    global $user;
    if (user_access('administer comments') || $user->uid == $comment->uid) {
        $url = drupal_get_path_alias('node/' . $variables['node']->nid) . '/comments';
        $variables['content']['links']['comment']['#links'] = array('comment-delete' => array('title' => '&nbsp;', 'href' => 'comment/' . $comment->cid . '/delete', 'query' => array('destination' => $url), 'html' => TRUE));
    }
    // Display "XX ago" for posts less than 1 day, otherwise use locale to format datetime
    $ago = time() - $comment->created;
    if ($ago < 86400) {
        $variables['created'] = t('!interval ago', array('!interval' => format_interval(time() - $comment->created)));
    } else {
        $locale = OpenFitUserSetting::getCurrentUserLocale();
        $fmt = new IntlDateFormatter($locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
        $created = new DateTime('now');
        $created->setTimestamp($comment->created);
        $variables['created'] = $fmt->format($created);
    }
    $variables['submitted'] = $variables['author'] . '&nbsp;' . '<time datetime="' . $variables['datetime'] . '" pubdate="pubdate">' . $variables['created'] . '</time>';
}
开发者ID:NeilBryant,项目名称:sufferhub,代码行数:28,代码来源:template.php


示例17: getExtraGridModeTabs

    protected static function getExtraGridModeTabs($retTabs, $readAuth, $args, $attributes)
    {
        // TBD add check for loctools
        global $indicia_templates;
        $isAdmin = user_access($args['edit_permission']);
        if (!$isAdmin) {
            return '';
        }
        if (!$retTabs) {
            return array('#downloads' => lang::get('Reports'), '#locations' => lang::get('LANG_Locations'));
        }
        $LocationTypeID = iform_mnhnl_getTermID(parent::$auth, 'indicia:location_types', $args['LocationTypeTerm']);
        $retVal = '<div id="downloads" >
    <p>' . lang::get('LANG_Data_Download') . '</p>
    <form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_butterflies2_sites_report.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv&filename=downloadsites">
      <input type="hidden" name="params" value=\'{"location_type_id":' . $LocationTypeID . '}\' />
      <label>' . lang::get('Sites report') . ':</label><input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('Download') . '">
    </form>
    <form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_butterflies2_conditions_report.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv&filename=downloadconditions">
      <input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . '}\' />
      <label>' . lang::get('Conditions report') . ':</label><input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('Download') . '">
    </form>
	<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_butterflies2_species_report.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv&filename=downloadoccurrences">
      <input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . '}\' />
      <label>' . lang::get('Species report') . ':</label><input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('Download') . '">
    </form>
  </div>' . iform_mnhnl_locModTool(parent::$auth, $args, parent::$node);
        return $retVal;
    }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:29,代码来源:mnhnl_butterflies2.php


示例18: churchauth_main

/**
 * main function for churchauth
 * @return string
 */
function churchauth_main()
{
    if (!user_access("administer persons", "churchcore")) {
        addInfoMessage(t("no.permission.for", "<i>administer persons</i>"));
        return " ";
    }
    drupal_add_css(ASSETS . '/fileuploader/fileuploader.css');
    drupal_add_js(BOOTSTRAP . '/js/bootstrap-multiselect.js');
    drupal_add_js(ASSETS . '/fileuploader/fileuploader.js');
    drupal_add_js(ASSETS . '/js/jquery.history.js');
    drupal_add_css(ASSETS . '/dynatree/ui.dynatree.css');
    drupal_add_js(ASSETS . '/dynatree/jquery.dynatree-1.2.4.js');
    drupal_add_js(CHURCHCORE . '/churchcore.js');
    drupal_add_js(CHURCHCORE . '/churchforms.js');
    drupal_add_js(CHURCHCORE . '/cc_abstractview.js');
    drupal_add_js(CHURCHCORE . '/cc_standardview.js');
    drupal_add_js(CHURCHCORE . '/cc_maintainstandardview.js');
    drupal_add_js(CHURCHCORE . '/cc_interface.js');
    drupal_add_js(CHURCHCORE . '/cc_authview.js');
    drupal_add_js(CHURCHCORE . '/cc_authmain.js');
    drupal_add_js(createI18nFile("churchcore"));
    $content = '
<div class="row-fluid">
  <div class="span3">
    <div id="cdb_menu"></div>
    <div id="cdb_filter"></div>
  </div>
  <div class="span9">
    <div id="cdb_search"></div>
    <div id="cdb_group"></div>
    <div id="cdb_content"></div>
  </div>
</div>';
    return $content;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:39,代码来源:churchauth.php


示例19: getMasterData

 public function getMasterData()
 {
     global $user, $base_url;
     $ret = array();
     $ret["modulename"] = "churchcal";
     $ret["modulespath"] = CHURCHCAL;
     $ret["churchservice_name"] = variable_get("churchservice_name");
     $ret["churchcal_name"] = variable_get("churchcal_name");
     $ret["churchresource_name"] = variable_get("churchresource_name");
     $ret["maincal_name"] = variable_get("churchcal_maincalname", "Gemeindekalender");
     $ret["base_url"] = $base_url;
     $ret["user_pid"] = $user->id;
     if (user_access("view", "churchdb")) {
         $ret["absent_reason"] = churchcore_getTableData("cs_absent_reason");
     }
     if (user_access("view", "churchresource") || user_access("create bookings", "churchresource")) {
         $ret["resources"] = churchcore_getTableData("cr_resource");
         $ret["resourceTypes"] = churchcore_getTableData("cr_resourcetype");
         $ret["bookingStatus"] = churchcore_getTableData("cr_status");
     }
     $ret["category"] = churchcal_getAllowedCategories(true);
     $ret["settings"] = churchcore_getUserSettings("churchcal", $user->id);
     $ret["repeat"] = churchcore_getTableData("cc_repeat");
     if (count($ret["settings"]) == 0) {
         $arr["checkboxEvents"] = "true";
         $ret["settings"] = $arr;
     }
     $ret["auth"] = churchcal_getAuthForAjax();
     return $ret;
 }
开发者ID:lhaselauer,项目名称:churchtools_basic,代码行数:30,代码来源:CTChurchCalModule.class.php


示例20: edit_form

 /**
  * Provide the actual editing form.
  */
 function edit_form(&$form, &$form_state)
 {
     parent::edit_form($form, $form_state);
     $item = $form_state['item'];
     $form['info']['admin_title']['#required'] = TRUE;
     $form['info']['admin_title']['#maxlength'] = 80;
     $form['path'] = array('#type' => 'textarea', '#title' => t('Paths'), '#default_value' => $item->path, '#maxlength' => 128, '#size' => 45, '#description' => t('Specify pages by using their paths. Enter one path per line. The \'*\' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.', array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')), '#required' => TRUE);
     $form['help'] = array('#type' => 'textarea', '#title' => t('Help message'), '#default_value' => $item->help, '#description' => t('Specify a help message.'), '#required' => TRUE);
     $form['options'] = array('#type' => 'vertical_tabs');
     $form['options_roles'] = array('#type' => 'fieldset', '#title' => t('Roles'), '#collapsible' => TRUE, '#group' => 'options', '#weight' => -50);
     $item->options = unserialize($item->options);
     $roles = user_roles(FALSE, 'view custom help text');
     // Get all Authenticated roles
     if (isset($roles[DRUPAL_AUTHENTICATED_RID])) {
         $roles += array_diff(user_roles(TRUE), $roles);
     }
     if (user_access('administer permissions')) {
         $permission_link = l(t('View custom help text'), 'admin/people/permissions', array('fragment' => 'module-custom_help_text'));
     } else {
         $permission_link = t('View custom help text');
     }
     $form['options_roles']['roles'] = array('#type' => 'checkboxes', '#options' => $roles, '#title' => t('User roles that can view the custom help text'), '#required' => TRUE, '#description' => t('Check the roles that needs to view the help message and have currently the permission \'!permission_url\'.', array('!permission_url' => $permission_link)));
     if (!empty($item->options['roles'])) {
         foreach ($item->options['roles'] as $role_name) {
             if ($role = user_role_load_by_name($role_name)) {
                 $form['options_roles']['roles']['#default_value'][] = $role->rid;
             }
         }
     } else {
         $form['options_roles']['roles']['#default_value'] = array();
     }
 }
开发者ID:samknelson,项目名称:grievance,代码行数:35,代码来源:custom_help_text_export_ui.class.php



注:本文中的user_access函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_accesstime_log函数代码示例发布时间:2022-05-23
下一篇:
PHP userUrl函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap