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

PHP param_alphanumext函数代码示例

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

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



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

示例1: define

define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'internal');
define('SECTION_PAGE', 'view');
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'group.php';
require_once 'pieforms/pieform.php';
require_once get_config('libroot') . 'view.php';
if (param_variable('acceptfriend_submit', null)) {
    acceptfriend_form(param_integer('id'));
} else {
    if (param_variable('addfriend_submit', null)) {
        addfriend_form(param_integer('id'));
    }
}
$loggedinid = $USER->get('id');
if ($profileurlid = param_alphanumext('profile', null)) {
    if (!($user = get_record('usr', 'urlid', $profileurlid, 'deleted', 0))) {
        if ($USER->is_logged_in()) {
            throw new UserNotFoundException("User {$profileurlid} not found");
        } else {
            // For logged-out users we show "access denied" in order to prevent an enumeration attack
            throw new AccessDeniedException(get_string('youcannotviewthisusersprofile', 'error'));
        }
    }
    $userid = $user->id;
} else {
    if (!empty($loggedinid)) {
        $userid = param_integer('id', $loggedinid);
    } else {
        $userid = param_integer('id');
    }
开发者ID:rboyatt,项目名称:mahara,代码行数:31,代码来源:view.php


示例2: define

 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('PUBLIC', 1);
require 'init.php';
$name = param_alphanumext('name', 'captcha');
// Get 5 random letters.
$code = get_random_key(5);
$angles = array(40, 0, 340, 20, 310);
$lefts = array(30, 50, 70, 95, 110);
$bottoms = array(24, 20, 28, 34, 33);
$file = theme_get_path('images/captcha.png');
$img = imagecreatefrompng($file);
$black = imagecolorallocate($img, 60, 60, 60);
$ttf = theme_get_path('captcha.ttf');
$captcha = '';
for ($i = 0; $i < strlen($code); $i++) {
    imagettftext($img, 18, $angles[$i], $lefts[$i], $bottoms[$i], $black, $ttf, $code[$i]);
    $captcha .= $code[$i];
}
$SESSION->set($name, $captcha);
开发者ID:Br3nda,项目名称:mahara,代码行数:31,代码来源:captcha.php


示例3: define

define('TITLE', get_string('pagetitle', 'search.elasticsearch'));
safe_require('search', 'elasticsearch');
define('SECTION_PLUGINTYPE', 'search');
define('SECTION_PLUGINNAME', 'elasticsearch');
define('SECTION_PAGE', 'elasticsearch');
global $USER;
if (!get_config('publicsearchallowed') && !$USER->is_logged_in()) {
    throw new AccessDeniedException();
}
$options = array();
$query = param_variable('query', '');
$mainfacetterm = param_alpha('mainfacetterm', null);
$options['secfacetterm'] = param_alpha('secfacetterm', '');
$options['owner'] = param_alpha('owner', '');
$options['tagsonly'] = param_boolean('tagsonly', false);
$options['sort'] = param_alphanumext('sort', null);
$options['license'] = param_variable('license', '');
$offset = param_integer('offset', 0);
$filter = param_alpha('filter', $USER->get('admin') ? 'all' : 'myinstitutions');
$limit = param_integer('limit', 10);
$filter = 'all';
$query = PluginSearchElasticsearch::clean_query($query);
$data = PluginSearchElasticsearch::search_all($query, $limit, $offset, $options, $mainfacetterm, $USER);
$data['query'] = $query;
// License
if (get_config('licensemetadata')) {
    $data['license_on'] = true;
    $license_options = array();
    $licenses = get_records_assoc('artefact_license', null, null, 'displayname');
    foreach ($licenses as $l) {
        $license_options[$l->name] = $l->displayname;
开发者ID:rboyatt,项目名称:mahara,代码行数:31,代码来源:index.php


示例4: array

$elements = array();
$elements['membership'] = array('type' => 'html', 'value' => '<h4>' . get_string('Membership', 'group') . '</h4>');
$cancreatecontrolled = $USER->get('admin') || $USER->get('staff') || $USER->is_institutional_admin() || $USER->is_institutional_staff();
$elements['open'] = array('type' => 'switchbox', 'title' => get_string('Open', 'group'), 'description' => get_string('opendescription', 'group'), 'defaultvalue' => $group_data->open, 'disabled' => !$cancreatecontrolled && $group_data->controlled);
if ($cancreatecontrolled || $group_data->controlled) {
    $elements['controlled'] = array('type' => 'switchbox', 'title' => get_string('Controlled', 'group'), 'description' => get_string('controlleddescription', 'group'), 'defaultvalue' => $group_data->controlled, 'disabled' => !$cancreatecontrolled);
} else {
    $form['elements']['controlled'] = array('type' => 'hidden', 'value' => $group_data->controlled);
}
$elements['request'] = array('type' => 'switchbox', 'title' => get_string('request', 'group'), 'description' => get_string('requestdescription', 'group'), 'defaultvalue' => !$group_data->open && $group_data->request, 'disabled' => $group_data->open);
// The grouptype determines the allowed roles
$grouptypeoptions = group_get_grouptype_options($group_data->grouptype);
// Hide the grouptype option if it was passed in as a parameter, if the user
// isn't allowed to change it, or if there's only one option.
if (!$id) {
    $grouptypeparam = param_alphanumext('grouptype', 0);
    if (isset($grouptypeoptions[$grouptypeparam])) {
        $group_data->grouptype = $grouptypeparam;
        $forcegrouptype = true;
    }
} else {
    if (!isset($grouptypeoptions[$group_data->grouptype])) {
        // The user can't create groups of this type.  Probably a non-staff user
        // who's been promoted to admin of a controlled group.
        $forcegrouptype = true;
    }
}
if (!empty($forcegrouptype) || count($grouptypeoptions) < 2) {
    $form['elements']['grouptype'] = array('type' => 'hidden', 'value' => $group_data->grouptype);
} else {
    $elements['grouptype'] = array('type' => 'select', 'title' => get_string('Roles', 'group'), 'options' => $grouptypeoptions, 'defaultvalue' => $group_data->grouptype, 'help' => true);
开发者ID:sarahjcotton,项目名称:mahara,代码行数:31,代码来源:edit.php


示例5: pieform_is_collapsed

/**
 * Check if the form is supposed to be collapsed
 * @param array      $element The element to render
 * @return boolean   if the fieldset should be collapsed
 */
function pieform_is_collapsed(Pieform $form, $element)
{
    $formname = $form->get_name();
    $iscollapsed = !empty($element['collapsed']);
    // if name element is not set, element should not be collapsed
    if (!isset($element['name'])) {
        return false;
    }
    $valid = param_alphanumext('fs', null) !== $element['name'];
    // Work out whether any of the children have errors on them
    foreach ($element['elements'] as $subelement) {
        if (isset($subelement['error'])) {
            return false;
            // collapsible element should be open
        }
    }
    if (isset($element['name'])) {
        $openparam = $formname . '_' . $element['name'] . '_open';
    }
    if ($iscollapsed && $valid && !param_boolean($openparam, false)) {
        return true;
    }
    return false;
}
开发者ID:rboyatt,项目名称:mahara,代码行数:29,代码来源:fieldset.php


示例6: define

 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configextensions/webservices/logs');
define('SECTION_PAGE', 'webservicelogs');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once 'webservicessearchlib.php';
define('TITLE', get_string('webservices_title', 'auth.webservice'));
require_once 'pieforms/pieform.php';
$userquery = param_variable('userquery', null);
$username = !empty($userquery) ? get_field('usr', 'username', 'id', $userquery) : '';
$functionquery = param_variable('functionquery', null);
$functionname = !empty($functionquery) ? get_field('external_functions', 'name', 'id', $functionquery) : '';
$search = (object) array('userquery' => $username, 'functionquery' => $functionname, 'protocol' => trim(param_alphanumext('protocol', 'all')), 'authtype' => trim(param_alphanum('authtype', 'all')), 'onlyerrors' => 'on' == param_alphanum('onlyerrors', 'off') ? 1 : 0, 'sortby' => param_alpha('sortby', 'timelogged'), 'sortdir' => param_alpha('sortdir', 'desc'), 'offset' => param_integer('offset', 0), 'limit' => param_integer('limit', 10));
if ($USER->get('admin')) {
    $institutions = get_records_array('institution', '', '', 'displayname');
    $search->institution = param_alphanum('institution', 'all');
} else {
    $institutions = get_records_select_array('institution', "name IN ('" . join("','", array_keys($USER->get('admininstitutions'))) . "')", null, 'displayname');
    $search->institution_requested = param_alphanum('institution_requested', 'all');
}
list($html, $columns, $searchurl, $pagination) = build_webservice_log_search_results($search);
$institutionselect = '';
if (count($institutions) > 1) {
    $selecttype = $USER->get('admin') ? 'institution' : 'institution_requested';
    $options = array('all' => get_string('All'));
    foreach ($institutions as $institution) {
        $options[$institution->name] = $institution->displayname;
    }
开发者ID:kienv,项目名称:mahara,代码行数:31,代码来源:webservicelogs.php


示例7: define

 *
 * @package    mahara
 * @subpackage artefact-multirecipientnotification
 * @author     David Ballhausen, Tobias Zeuch
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('artefact', 'multirecipientnotification');
global $USER;
global $THEME;
$readone = param_integer('readone', 0);
$table = param_alphanumext('table', 'notification_internal_activity');
$markasread = param_integer('markasread', 0);
$delete = param_integer('delete', 0);
if ($readone) {
    if ('notification_internal_activity' === $table) {
        set_field($table, 'read', 1, 'id', $readone, 'usr', $USER->get('id'));
    } else {
        if ('artefact_multirecipient_notification' === $table) {
            mark_as_read_mr(array($readone), $USER->get('id'));
        }
    }
    $unread = $USER->add_unread(-1);
    $data = array('newunreadcount' => $unread, 'newimage' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'));
    json_reply(false, array('data' => $data));
}
require_once get_config('libroot') . 'activity.php';
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:indexin.json.php


示例8: define

<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
$rawstring = param_alphanumext('string');
$section = param_alphanumext('section');
$args = param_variable('args', null);
if (!empty($args) && is_array($args)) {
    array_unshift($args, $rawstring, $section);
    $string = call_user_func_array('get_string', $args);
} else {
    $string = get_string($rawstring, $section);
}
json_reply(false, array('message' => null, 'data' => array('string' => $string)));
开发者ID:agwells,项目名称:Mahara-1,代码行数:24,代码来源:get_string.php


示例9: define

define('MENUITEM', 'adminhome/statistics');
require dirname(dirname(__FILE__)) . '/init.php';
require get_config('libroot') . 'registration.php';
define('TITLE', get_string('sitestatistics', 'admin'));
$type = param_alpha('type', 'users');
$subpages = array('users', 'groups', 'views', 'content', 'historical', 'institutions');
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
if (!in_array($type, $subpages)) {
    $type = 'users';
}
if ($type == 'historical') {
    $field = param_alphanumext('field', 'count_usr');
}
if ($type == 'institutions') {
    $sort = param_alphanumext('sort', 'displayname');
    $sortdesc = param_boolean('sortdesc');
}
$sitedata = site_statistics(true);
switch ($type) {
    case 'institutions':
        $data = institution_comparison_statistics($limit, $offset, $sort, $sortdesc);
        break;
    case 'historical':
        $data = historical_statistics($limit, $offset, $field);
        break;
    case 'content':
        $data = content_statistics($limit, $offset);
        break;
    case 'groups':
        $data = group_statistics($limit, $offset);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:statistics.php


示例10: define

 * @subpackage core
 * @author     Richard Mansfield
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('PUBLIC', 1);
require 'init.php';
require_once 'file.php';
$type = param_alpha('type', null);
if ($type == 'sitemap') {
    if (!get_config('generatesitemap')) {
        throw new NotFoundException(get_string('filenotfound'));
    }
    if ($name = param_alphanumext('name', null)) {
        if (!preg_match('/^sitemap_[a-z0-9_]+\\.xml(\\.gz)?$/', $name, $m)) {
            throw new NotFoundException(get_string('filenotfound'));
        }
        $mimetype = empty($m[1]) ? 'text/xml' : 'application/gzip';
    } else {
        $name = 'sitemap_index.xml';
        $mimetype = 'text/xml';
    }
    $path = get_config('dataroot') . 'sitemaps/' . $name;
} else {
    $data = $SESSION->get('downloadfile');
    if (!$USER->is_logged_in() || empty($data) || empty($data['file'])) {
        throw new NotFoundException(get_string('filenotfound'));
    }
    $path = get_config('dataroot') . 'export/' . $USER->get('id') . '/' . $data['file'];
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:download.php


示例11: define

 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'view.php';
$view = new View(param_integer('id'));
$change = param_boolean('change', false);
$action = param_alphanumext('action', '');
// If the view has been submitted, disallow editing
if ($view->is_submitted()) {
    $submittedto = $view->submitted_to();
    throw new AccessDeniedException(get_string('canteditsubmitted', 'view', $submittedto['name']));
}
// we actually ned to process stuff
if ($change) {
    try {
        $returndata = $view->process_changes();
        json_reply(false, $returndata);
    } catch (Exception $e) {
        json_reply(true, $e->getMessage());
    }
}
// else we're just reading data...
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:blocks.json.php


示例12: define

 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('PUBLIC', 1);
define('MENUITEM', '');
define('HOME', 1);
require 'init.php';
define('TITLE', get_string('home'));
// Check for whether the user is logged in, before processing the page. After
// this, we can guarantee whether the user is logged in or not for this page.
if (!$USER->is_logged_in()) {
    $pagename = 'loggedouthome';
    $lang = param_alphanumext('lang', null);
    if (!empty($lang)) {
        $SESSION->set('lang', $lang);
        redirect();
    }
} else {
    $pagename = 'home';
}
if ($USER->is_logged_in()) {
    // get the user's dashboard view
    require_once get_config('libroot') . 'view.php';
    $view = $USER->get_view_by_type('dashboard');
    $stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
    $smarty = smarty(array('paginator'), $stylesheets, array(), array('stylesheets' => array('style/views.css')));
    if ($USER->get_account_preference('showhomeinfo')) {
        // allow the user to choose never to see the info boxes again
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:index.php


示例13: define

 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('PUBLIC', 1);
define('MENUITEM', 'groups/info');
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'group.php';
require_once 'searchlib.php';
require_once get_config('docroot') . 'interaction/lib.php';
require_once get_config('libroot') . 'view.php';
safe_require('artefact', 'file');
if ($urlid = param_alphanumext('homepage', null)) {
    define('GROUPURLID', $urlid);
    $group = group_current_group();
} else {
    define('GROUP', param_integer('id'));
    $group = group_current_group();
}
if (!is_logged_in() && !$group->public) {
    throw new AccessDeniedException();
}
define('TITLE', $group->name);
$group->role = group_user_access($group->id);
// logged in user can do stuff
if ($USER->is_logged_in()) {
    $afterjoin = param_variable('next', 'view');
    if ($group->role) {
开发者ID:sarahjcotton,项目名称:mahara,代码行数:31,代码来源:view.php


示例14: define

 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
if (!defined('INTERNAL')) {
    define('INTERNAL', 1);
}
require_once dirname(dirname(__FILE__)) . '/init.php';
if (!defined('CRON')) {
    define('JSON', 1);
    json_headers();
    $validtypes = array('Line', 'Bar', 'Radar', 'PolarArea', 'Pie', 'Doughnut');
    $type = ucfirst(param_alphanum('type', false));
    if (!in_array($type, $validtypes)) {
        json_reply('missingparameter', '\'' . $type . '\' is not a valid graph type');
    }
    $graph = param_alphanumext('graph', null);
    $colours = param_variable('colours', null);
    $colours = json_decode($colours);
    $extradata = param_variable('extradata', null);
    $extradata = json_decode($extradata);
    require_once get_config('libroot') . 'graph.php';
    require_once get_config('libroot') . 'registration.php';
    if (!function_exists($graph) || !in_array($graph, allowed_graph_functions())) {
        json_reply('invalidparameter', 'Cannot call graph function \'' . $graph . '\'');
    } else {
        $data = $extradata ? $graph($type, $extradata) : $graph($type);
        if (empty($data)) {
            $data['empty'] = true;
            json_reply(false, array('data' => $data));
        }
        $data['configs'] = isset($extradata->configs) ? $extradata->configs : (object) array();
开发者ID:rboyatt,项目名称:mahara,代码行数:31,代码来源:graphdata.php


示例15: save_protos_switch

        });
        \$('#activate_webservice_protos_xmlrpc_enabled').change(function() {
            save_protos_switch('xmlrpc');
        });
        \$('#activate_webservice_protos_rest_enabled').change(function() {
            save_protos_switch('rest');
        });
        \$('#activate_webservice_protos_oauth_enabled').change(function() {
            save_protos_switch('oauth');
        });
    });
JS;
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('form', $form);
$smarty->assign('opened', param_alphanumext('open', ''));
$smarty->assign('SUBPAGENAV', $webservice_menu);
$smarty->assign('PAGEHEADING', $heading);
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('pagedescription', get_string('webservicesconfigdesc', 'auth.webservice'));
$smarty->display('auth:webservice:configform.tpl');
/* pieforms callback for activate_webservices for
 */
function activate_webservices_submit(Pieform $form, $values)
{
    $enabled = $values['enabled'] ? 0 : 1;
    set_config('webservice_enabled', $enabled);
    // reload/upgrade the web services configuration
    if ($enabled) {
        // ensure that we have a webservice auth_instance
        $authinstance = get_record('auth_instance', 'institution', 'mahara', 'authname', 'webservice');
开发者ID:patkira,项目名称:mahara,代码行数:31,代码来源:index.php


示例16: pieform

} else {
    if (!empty($institution)) {
        $institutionelement['defaultvalue'] = $institution;
    }
}
$institutionselector = pieform(array('name' => 'usertypeselect', 'elements' => array('institution' => $institutionelement)));
define('TITLE', get_string('institutionstatisticsfor', 'admin', get_field('institution', 'displayname', 'name', $institution)));
$type = param_alpha('type', 'users');
$subpages = array('users', 'views', 'content', 'historical');
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
if (!in_array($type, $subpages)) {
    $type = 'users';
}
if ($type == 'historical') {
    $field = param_alphanumext('field', 'count_members');
}
$institutiondata = institution_statistics($institution, true);
switch ($type) {
    case 'historical':
        $data = institution_historical_statistics($limit, $offset, $field, $institutiondata);
        break;
    case 'content':
        $data = institution_content_statistics($limit, $offset, $institutiondata);
        break;
    case 'views':
        $data = institution_view_statistics($limit, $offset, $institutiondata);
        break;
    case 'users':
    default:
        $data = institution_user_statistics($limit, $offset, $institutiondata);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:statistics.php


示例17: define

 *
 * @package    mahara
 * @subpackage module-multirecipientnotification
 * @author     David Ballhausen, Tobias Zeuch
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('module', 'multirecipientnotification');
global $USER;
global $THEME;
$readone = param_integer('readone', 0);
$list = param_alphanumext('list', 'notification_internal_activity');
$markasread = param_integer('markasread', 0);
$delete = param_integer('delete', 0);
if ($readone) {
    if ('notification_internal_activity' === $list) {
        set_field($list, 'read', 1, 'id', $readone, 'usr', $USER->get('id'));
    } else {
        if ('artefact_multirecipient_notification' === $list) {
            mark_as_read_mr(array($readone), $USER->get('id'));
        }
    }
    $unread = $USER->add_unread(-1);
    $data = array('newunreadcount' => $unread);
    json_reply(false, array('data' => $data));
}
require_once get_config('libroot') . 'activity.php';
开发者ID:rboyatt,项目名称:mahara,代码行数:31,代码来源:indexout.json.php


示例18: pieform_element_fieldset

/**
 * Renders a fieldset. Fieldsets contain other elements, and do not count as a
 * "true" element, in that they do not have a value and cannot be validated.
 *
 * @param Pieform $form    The form to render the element for
 * @param array   $element The element to render
 * @return string          The HTML for the element
 */
function pieform_element_fieldset(Pieform $form, $element)
{
    /*{{{*/
    global $_PIEFORM_FIELDSETS;
    $result = "\n<fieldset";
    $classes = array('pieform-fieldset');
    if (!empty($element['class'])) {
        $classes[] = Pieform::hsc($element['class']);
    }
    if (!empty($element['collapsible'])) {
        if (!isset($element['legend']) || $element['legend'] === '') {
            Pieform::info('Collapsible fieldsets should have a legend so they can be toggled');
        }
        $classes[] = 'collapsible';
        $formname = $form->get_name();
        if (!isset($_PIEFORM_FIELDSETS['forms'][$formname])) {
            $_PIEFORM_FIELDSETS['forms'][$formname] = array('formname' => $formname);
        }
        if (isset($element['name'])) {
            $openparam = $formname . '_' . $element['name'] . '_open';
        }
        // Work out whether any of the children have errors on them
        $error = false;
        foreach ($element['elements'] as $subelement) {
            if (isset($subelement['error'])) {
                $error = true;
                break;
            }
        }
        if (!empty($element['collapsed']) && !$error && (!isset($element['name']) || param_alphanumext('fs', null) != $element['name'] && !param_boolean($openparam, false))) {
            $classes[] = 'collapsed';
        }
    }
    $result .= ' class="' . implode(' ', $classes) . '"';
    $result .= ">\n";
    if (isset($element['legend'])) {
        $result .= '<legend><h4>';
        if (!empty($element['collapsible'])) {
            $result .= '<a href="">' . Pieform::hsc($element['legend']) . '</a>';
            if (isset($openparam)) {
                $result .= '<input type="hidden" name="' . hsc($openparam) . '" class="open-fieldset-input" ' . 'value="' . intval(!in_array('collapsed', $classes)) . '">';
            }
        } else {
            $result .= Pieform::hsc($element['legend']);
        }
        // Help icon
        if (!empty($element['help'])) {
            $function = $form->get_property('helpcallback');
            if (function_exists($function)) {
                $result .= $function($form, $element);
            } else {
                $result .= '<span class="help"><a href="" title="' . Pieform::hsc($element['help']) . '" onclick="return false;">?</a></span>';
            }
        }
        $result .= "</h4></legend>\n";
    }
    if (!empty($element['renderer']) && $element['renderer'] == 'multicolumnfieldsettable') {
        $result .= _render_elements_as_multicolumn($form, $element);
    } else {
        foreach ($element['elements'] as $subname => $subelement) {
            if ($subelement['type'] == 'hidden') {
                throw new PieformException("You cannot put hidden elements in fieldsets");
            }
            $result .= "\t" . pieform_render_element($form, $subelement);
        }
    }
    $result .= "</fieldset>\n";
    return $result;
}
开发者ID:vohung96,项目名称:mahara,代码行数:77,代码来源:fieldset.php


示例19: get_config_plugin

$samlconfig = get_config_plugin('auth', 'saml', 'simplesamlphpconfig');
// get all the things that we will need from the SAML authentication
// and then shutdown the session control
SimpleSAML_Configuration::init($samlconfig);
$saml_session = SimpleSAML_Session::getInstance();
// do we have a logout request?
if (param_variable("logout", false)) {
    // logout the saml session
    $sp = $saml_session->getAuthority();
    if (!$sp) {
        $sp = 'default-sp';
    }
    $as = new SimpleSAML_Auth_Simple($sp);
    $as->logout($CFG->wwwroot);
}
$sp = param_alphanumext('as', 'default-sp');
if (!in_array($sp, SimpleSAML_Auth_Source::getSources())) {
    $sp = 'default-sp';
}
$as = new SimpleSAML_Auth_Simple($sp);
// Check the SimpleSAMLphp config is compatible
$saml_config = SimpleSAML_Configuration::getInstance();
$session_handler = $saml_config->getString('session.handler', false);
$store_type = $saml_config->getString('store.type', false);
if ($store_type == 'phpsession' || $session_handler == 'phpsession' || empty($store_type) && empty($session_handler)) {
    throw new AuthInstanceException(get_string('errorbadssphp', 'auth.saml'));
}
// what is the session like?
$valid_saml_session = $saml_session->isValid($sp);
// figure out what the returnto URL should be
$wantsurl = param_variable("wantsurl", false);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:index.php


示例20: define

<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('STAFF', 1);
require dirname(dirname(__FILE__)) . '/init.php';
$type = param_alphanumext('type');
if (preg_match('/^([a-z]*_)?(viewtypes|weekly)$/', $type) || $type == 'institutions' || $type == 'grouptypes') {
    header('Content-type: ' . 'image/png');
    if (!get_config('nocache')) {
        $maxage = 3600;
        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $maxage) . ' GMT');
        header('Cache-Control: max-age=' . $maxage);
        header('Pragma: public');
    }
    readfile(get_config('dataroot') . 'images/' . $type . '.png');
    exit;
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:26,代码来源:thumb.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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