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

PHP param_alphanum函数代码示例

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

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



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

示例1: define

 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configextensions/pluginadmin');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
define('TITLE', get_string('pluginadmin', 'admin'));
require_once 'pieforms/pieform.php';
$plugintype = param_alpha('plugintype');
$pluginname = param_variable('pluginname');
define('SECTION_PLUGINTYPE', $plugintype);
define('SECTION_PLUGINNAME', $pluginname);
define('SECTION_PAGE', 'pluginconfig');
safe_require($plugintype, $pluginname);
if ($sesskey = param_alphanum('sesskey', '')) {
    if ($sesskey != $USER->get('sesskey')) {
        throw new UserException('Invalid sesskey');
    }
}
$enable = param_integer('enable', 0);
$disable = param_integer('disable', 0);
if ($disable && !call_static_method(generate_class_name($plugintype, $pluginname), 'can_be_disabled')) {
    throw new UserException("Plugin {$plugintype} {$pluginname} cannot be disabled");
}
if ($enable || $disable) {
    if ($plugintype == 'blocktype') {
        if (strpos($pluginname, '/') !== false) {
            list($artefact, $pluginname) = split('/', $pluginname);
            // Don't enable blocktypes unless the artefact plugin that provides them is also enabled
            if ($enable && !get_field('artefact_installed', 'active', 'name', $artefact)) {
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:pluginconfig.php


示例2: process_changes

 /**
  * Process view changes. This function is used both by the json stuff and
  * by normal posts
  */
 public function process_changes($category = '', $new = 0)
 {
     global $SESSION, $USER;
     // Security
     // TODO this might need to be moved below the requestdata check below, to prevent non owners of the view being
     // rejected
     if (!$USER->can_edit_view($this)) {
         throw new AccessDeniedException(get_string('canteditdontown', 'view'));
     }
     if (!count($_POST) && count($_GET) < 3) {
         return;
     }
     $action = '';
     foreach ($_POST as $key => $value) {
         if (substr($key, 0, 7) == 'action_') {
             $action = substr($key, 7);
             break;
         } else {
             if (substr($key, 0, 37) == 'cancel_action_configureblockinstance_' && param_integer('removeoncancel', 0)) {
                 $action = 'removeblockinstance_' . substr($key, 37);
                 break;
             }
         }
     }
     // TODO Scan GET for an action. The only action that is GETted is
     // confirming deletion of a blockinstance. It _should_ be a POST, but
     // that can be fixed later.
     if (!$action) {
         foreach ($_GET as $key => $value) {
             if (substr($key, 0, 7) == 'action_') {
                 $action = substr($key, 7);
             }
         }
     }
     $viewtheme = param_variable('viewtheme', '');
     if ($viewtheme && $viewtheme != $this->get('theme')) {
         $action = 'changetheme';
         $values = array('theme' => $viewtheme);
     }
     if (empty($action)) {
         return;
     }
     form_validate(param_alphanum('sesskey', null));
     if (!isset($values)) {
         $actionstring = $action;
         $action = substr($action, 0, strpos($action, '_'));
         $actionstring = substr($actionstring, strlen($action) + 1);
         // Actions from <input type="image"> buttons send an _x and _y
         if (substr($actionstring, -2) == '_x' || substr($actionstring, -2) == '_y') {
             $actionstring = substr($actionstring, 0, -2);
         }
         $values = self::get_values_for_action($actionstring);
     }
     $result = null;
     switch ($action) {
         // the view class method is the same as the action,
         // but I've left these here in case any additional
         // parameter handling has to be done.
         case 'addblocktype':
             // requires action_addblocktype  (blocktype in separate parameter)
             $values['blocktype'] = param_alpha('blocktype', null);
             break;
         case 'removeblockinstance':
             // requires action_removeblockinstance_id_\d
             if (!defined('JSON')) {
                 if (!($sure = param_boolean('sure'))) {
                     $yesform = '<form action="' . get_config('wwwroot') . '/view/blocks.php" class="text-inline">' . '<input type="hidden" name="id" value="' . $this->get('id') . '">' . '<input type="hidden" name="c" value="file">' . '<input type="hidden" name="action_' . $action . '_' . $actionstring . '" value="1">' . '<input type="hidden" name="sure" value="1">' . '<input type="hidden" name="sesskey" value="' . $USER->get('sesskey') . '">' . '<input class="submit btn btn-primary" type="submit" name="removeblock_submit" value="' . get_string('yes') . '">' . '</form>';
                     $baselink = get_config('wwwroot') . 'view/blocks.php?id=' . $this->get('id') . '&c=' . $category . '&new=' . $new;
                     $SESSION->add_info_msg(get_string('confirmdeleteblockinstance', 'view') . '&nbsp;' . $yesform . ' <a href="' . $baselink . '">' . get_string('no') . '</a>', false);
                     redirect($baselink);
                     exit;
                 }
             }
             break;
         case 'configureblockinstance':
             // requires action_configureblockinstance_id_\d_column_\d_order_\d
         // requires action_configureblockinstance_id_\d_column_\d_order_\d
         case 'acsearch':
             // requires action_acsearch_id_\d
             if (!defined('JSON')) {
                 $this->blockinstance_currently_being_configured = $values['id'];
                 // And we're done here for now
                 return;
             }
         case 'moveblockinstance':
             // requires action_moveblockinstance_id_\d_row_\d_column_\d_order_\d
         // requires action_moveblockinstance_id_\d_row_\d_column_\d_order_\d
         case 'addcolumn':
             // requires action_addcolumn_\d_row_\d_before_\d
         // requires action_addcolumn_\d_row_\d_before_\d
         case 'removecolumn':
             // requires action_removecolumn_\d_row_\d_column_\d
         // requires action_removecolumn_\d_row_\d_column_\d
         case 'changetheme':
         case 'updatecustomlayoutpreview':
         case 'addcustomlayout':
//.........这里部分代码省略.........
开发者ID:sarahjcotton,项目名称:mahara,代码行数:101,代码来源:view.php


示例3: sitepages_institutionname_by_theme

 /**
  * Get institution name by checking which 'institution theme' a user is allocated to see
  * and if that theme has sitepages set.
  * Or if a lastinstitution cookie is set. Or if an institution url parameter is set.
  * Defaults to 'mahara'.
  *
  * @return string   Institution name
  */
 public function sitepages_institutionname_by_theme($page)
 {
     // get institution when logged in
     if ($this->is_logged_in()) {
         if ($theme = $this->get('institutiontheme')) {
             if (!empty($theme->institutionname)) {
                 // check to see if institution is using it's own site pages or default site pages
                 if ($institution = get_record('institution', 'name', $theme->institutionname)) {
                     if (get_config_institution($institution->name, 'sitepages_' . $page)) {
                         return get_config_institution($institution->name, 'sitepages_' . $page);
                     }
                 } else {
                     return $theme->institutionname;
                 }
             } else {
                 return 'mahara';
             }
         }
     }
     // or from url
     if ($institution = param_alphanum('institution', null)) {
         return $institution;
     }
     // or from cookie
     if ($institution = get_cookie('lastinstitution')) {
         return $institution;
     }
     return 'mahara';
 }
开发者ID:sarahjcotton,项目名称:mahara,代码行数:37,代码来源:user.php


示例4: progressbar_sideblock

function progressbar_sideblock($preview = false)
{
    global $USER;
    // TODO: Remove this URL param from here, and when previewing pass institution
    // by function param instead
    $institution = param_alphanum('i', null);
    if (is_array($USER->institutions) && count($USER->institutions) > 0) {
        // Get all institutions where user is member
        $institutions = array();
        foreach ($USER->institutions as $inst) {
            if (empty($inst->suspended)) {
                $institutions = array_merge($institutions, array($inst->institution => $inst->displayname));
            }
        }
        // Set user's first institution in case that institution isn't
        // set yet or user is not member of currently set institution.
        if (!$institution || !array_key_exists($institution, $institutions)) {
            $institution = key(array_slice($institutions, 0, 1));
        }
    } else {
        $institutions = array();
        $institution = 'mahara';
    }
    // Set appropriate preview according to institution, if the institutio is selected
    // If the institution isn't selected then show preview for first institution, which
    // is also selected as a default value in institution selection box
    if ($preview) {
        $default = get_column('institution', 'name');
        // TODO: Remove this URL param from here, and when previewing pass institution
        // by function param instead
        $institution = param_alphanum('institution', $default[0]);
    }
    // We need to check to see if any of the institutions have profile completeness to allow
    // the select box to work correctly for users with more than one institution
    $multiinstitutionprogress = false;
    $counting = null;
    if (!empty($institutions)) {
        foreach ($institutions as $key => $value) {
            if ($result = get_records_select_assoc('institution_config', 'institution=? and field like \'progressbaritem_%\'', array($key), 'field', 'field, value')) {
                $multiinstitutionprogress = true;
                if ($key == $institution) {
                    $counting = $result;
                    break;
                }
            }
        }
    } else {
        $counting = get_records_select_assoc('institution_config', 'institution=? and field like \'progressbaritem_%\'', array($institution), 'field', 'field, value');
    }
    // Get artefacts that count towards profile completeness
    if ($counting) {
        // Without locked ones (site locked and institution locked)
        $sitelocked = (array) get_column('institution_locked_profile_field', 'profilefield', 'name', 'mahara');
        $instlocked = (array) get_column('institution_locked_profile_field', 'profilefield', 'name', $institution);
        $locked = $sitelocked + $instlocked;
        foreach ($locked as $l) {
            unset($counting["progressbaritem_internal_{$l}"]);
        }
        $totalcounting = 0;
        foreach ($counting as $c) {
            $totalcounting = $totalcounting + $c->value;
        }
        // Get all artefacts for progressbar and create data structure
        $data = array();
        // For the artefact_get_progressbar_items function, we want them indexed by plugin
        // and then subindexed by artefact. For most other purposes, having them indexed
        // by config name is sufficient
        $onlytheseplugins = array();
        foreach ($counting as $key => $obj) {
            // This one has no value. So remove it from the list.
            if (!$obj->value) {
                unset($counting[$key]);
                continue;
            }
            $parts = explode('_', $obj->field);
            $plugin = $parts[1];
            $item = $parts[2];
            if (empty($onlytheseplugins[$plugin])) {
                $onlytheseplugins[$plugin] = array();
            }
            $onlytheseplugins[$plugin][$item] = $item;
        }
        $progressbaritems = artefact_get_progressbar_items($onlytheseplugins);
        // Get the data link about every item
        foreach ($progressbaritems as $pluginname => $itemlist) {
            foreach ($itemlist as $artefactname => $item) {
                $itemname = "progressbaritem_{$pluginname}_{$artefactname}";
                $c = $counting[$itemname];
                $target = $c->value;
                $completed = 0;
                $data[$itemname] = array('artefact' => $artefactname, 'link' => progressbar_artefact_link($pluginname, $artefactname), 'counting' => $target, 'completed' => $completed, 'display' => (bool) $c->value, 'label' => progressbar_artefact_task_label($pluginname, $artefactname, $target, $completed));
            }
        }
        if ($preview) {
            $percent = 0;
        } else {
            // Since this is not a preview, gather data about the users' actual progress,
            // and update the records we placed in $data.
            // Get a list of all the basic artefact types in this progress bar.
            $nonmeta = array();
//.........这里部分代码省略.........
开发者ID:kienv,项目名称:mahara,代码行数:101,代码来源:mahara.php


示例5: define

define('PUBLIC', 1);
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'view');
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'view.php';
require_once get_config('libroot') . 'collection.php';
require_once get_config('libroot') . 'objectionable.php';
require_once 'institution.php';
require_once 'group.php';
safe_require('artefact', 'comment');
safe_require('artefact', 'file');
// access key for roaming teachers
$mnettoken = $SESSION->get('mnetuser') ? param_alphanum('mt', null) : null;
// access key for logged out users
$usertoken = is_null($mnettoken) && get_config('allowpublicviews') ? param_alphanum('t', null) : null;
if ($mnettoken) {
    if (!($viewid = get_view_from_token($mnettoken, false))) {
        throw new AccessDeniedException(get_string('accessdenied', 'error'));
    }
} else {
    if ($usertoken) {
        if (!($viewid = get_view_from_token($usertoken, true))) {
            throw new AccessDeniedException(get_string('accessdenied', 'error'));
        }
    } else {
        if ($pageurl = param_alphanumext('page', null)) {
            if ($profile = param_alphanumext('profile', null)) {
                $view = new View(array('urlid' => $pageurl, 'ownerurlid' => $profile));
            } else {
                if ($homepage = param_alphanumext('homepage', null)) {
开发者ID:agwells,项目名称:Mahara-1,代码行数:31,代码来源:view.php


示例6: define

 */
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'managegroups/archives');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
define('TITLE', get_string('archivedsubmissions', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'archives');
require_once 'searchlib.php';
$search = (object) array('query' => trim(param_variable('query', '')), 'sortby' => param_alpha('sortby', 'firstname'), 'sortdir' => param_alpha('sortdir', 'asc'));
$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 {
    $institutionnames = array_keys($USER->get('admininstitutions'));
    $institutions = get_records_select_array('institution', 'suspended = 0 AND name IN (' . join(',', array_fill(0, count($institutionnames), '?')) . ')', $institutionnames, 'displayname');
}
list($html, $columns, $pagination, $search) = build_admin_archived_submissions_results($search, $offset, $limit);
$js = <<<EOF
addLoadEvent(function() {
    var p = {$pagination['javascript']}

    new UserSearch(p);
})
EOF;
$smarty = smarty(array('adminexportqueue', 'paginator'), array(), array('ascending' => 'mahara', 'descending' => 'mahara'));
$smarty->assign('search', $search);
$smarty->assign('limit', $limit);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:archives.php


示例7: param_boolean

$edit = param_boolean('edit');
$json = param_boolean('j');
$instanceid = param_variable('id', 0);
// IF WE'RE EDITING OR CREATING AN AUTHORITY:
if ($institution && $plugin) {
    $classname = 'PluginAuth' . ucfirst(strtolower($plugin));
    safe_require('auth', strtolower($plugin));
    $has_instance_config = call_static_method($classname, 'has_instance_config');
    if (false == $has_instance_config && $add) {
        // We've been asked to add an instance of an auth plugin that has no
        // config options. We've been called by an AJAX request, so we just
        // add the instance and generate an acknowledgement.
        // The session key has not been checked yet, because this page doesn't
        // define JSON
        try {
            form_validate(param_alphanum('sesskey', null));
        } catch (UserException $e) {
            json_reply(true, $e->getMessage());
        }
        $authinstance = new stdClass();
        // Get the auth instance with the highest priority number (which is
        // the instance with the lowest priority).
        // TODO: rethink 'priority' as a fieldname... it's backwards!!
        $lastinstance = get_records_array('auth_instance', 'institution', $institution, 'priority DESC', '*', '0', '1');
        if ($lastinstance == false) {
            $authinstance->priority = 0;
        } else {
            $authinstance->priority = $lastinstance[0]->priority + 1;
        }
        $authinstance->instancename = $plugin;
        $authinstance->institution = $institution;
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:addauthority.php


示例8: array

                $elements[$name] = array('title' => $name, 'type' => 'text');
            }
        }
        if ($authtype == 'user') {
            $username = param_alphanum('wsusername', '');
            $password = param_alphanum('wspassword', '');
            $elements['wsusername'] = array('title' => 'wsusername', 'type' => 'text', 'value' => $username);
            $elements['wspassword'] = array('title' => 'wspassword', 'type' => 'text', 'value' => $password);
            if ($username) {
                $params[] = 'wsusername=' . $username;
            }
            if ($password) {
                $params[] = 'wspassword=' . $password;
            }
        } else {
            $wstoken = param_alphanum('wstoken', '');
            $elements['wstoken'] = array('title' => 'wstoken', 'type' => 'text', 'value' => $wstoken);
            if ($wstoken) {
                $params[] = 'wstoken=' . $wstoken;
            }
        }
        $nextaction = get_string('execute', 'auth.webservice');
    }
}
$elements['submit'] = array('type' => 'submitcancel', 'value' => array($nextaction, get_string('cancel')), 'goto' => get_config('wwwroot') . 'webservice/testclient.php');
if (!empty($elements['protocol']['options'])) {
    $form = pieform(array('name' => 'testclient', 'renderer' => 'table', 'type' => 'div', 'successcallback' => 'testclient_submit', 'elements' => $elements));
} else {
    $form = '';
}
$smarty = smarty();
开发者ID:agwells,项目名称:Mahara-1,代码行数:31,代码来源:testclient.php


示例9: 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';
json_headers();
$instance = param_alphanum('instance');
if (isset($_SESSION['progress_meters'][$instance])) {
    $data = $_SESSION['progress_meters'][$instance];
    if ($data['finished']) {
        $SESSION->set_progress($instance, FALSE);
    }
} else {
    $data = array();
}
json_reply(false, array('data' => $data));
开发者ID:rboyatt,项目名称:mahara,代码行数:25,代码来源:progress_meter.php


示例10: define

define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'view');
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'view.php';
require_once get_config('libroot') . 'collection.php';
require_once get_config('libroot') . 'objectionable.php';
require_once 'institution.php';
require_once 'group.php';
safe_require('artefact', 'comment');
// access key for roaming teachers
$mnettoken = $SESSION->get('mnetuser') ? param_alphanum('mt', null) : null;
// access key for logged out users
// OVERWRITE 1: replacement, changed from:
//$usertoken = (is_null($mnettoken) && get_config('allowpublicviews')) ? param_alphanum('t', null) : null;
// to:
$usertoken = is_null($mnettoken) ? param_alphanum('t', null) : null;
// END OVERWRITE 1
if ($mnettoken) {
    if (!($viewid = get_view_from_token($mnettoken, false))) {
        throw new AccessDeniedException(get_string('accessdenied', 'error'));
    }
} else {
    if ($usertoken) {
        if (!($viewid = get_view_from_token($usertoken, true))) {
            throw new AccessDeniedException(get_string('accessdenied', 'error'));
        }
    } else {
        if ($pageurl = param_alphanumext('page', null)) {
            if ($profile = param_alphanumext('profile', null)) {
                $view = new View(array('urlid' => $pageurl, 'ownerurlid' => $profile));
            } else {
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:view.php


示例11: define

 * @subpackage artefact-survey
 * @author     Gregor Anzelj
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2010-2011 Gregor Anzelj <[email protected]>
 *
 */
define('INTERNAL', true);
define('MENUITEM', 'content/surveys');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'survey');
define('SECTION_PAGE', 'edit');
require_once dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once 'pieforms/pieform.php';
safe_require('artefact', 'survey');
$id = param_integer('id');
$fieldset = param_alphanum('fs', 'tab1');
$is_survey = get_field('artefact', 'artefacttype', 'id', $id) == 'survey' ? true : false;
$user_is_owner = $USER->get('id') == get_field('artefact', 'owner', 'id', $id) ? true : false;
if (!$is_survey) {
    throw new ArtefactNotFoundException(get_string('artefactnotsurvey', 'artefact.survey'));
}
if (!$user_is_owner) {
    throw new AccessDeniedException(get_string('accessdenied', 'error'));
}
$survey = null;
try {
    $survey = artefact_instance_from_id($id);
} catch (Exception $e) {
}
if ($USER->get('id') != $survey->get('owner')) {
    $SESSION->add_error_msg(get_string('canteditdontown'));
开发者ID:gbleydon,项目名称:mahara-survey,代码行数:31,代码来源:edit.php


示例12: 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(dirname(__FILE__))) . '/init.php';
require_once 'searchlib.php';
$params = new StdClass();
$params->query = trim(param_variable('query', ''));
$params->institution = param_alphanum('institution', null);
$params->lastinstitution = param_alphanum('lastinstitution', null);
$params->requested = param_integer('requested', null);
$params->invitedby = param_integer('invitedby', null);
$params->member = param_integer('member', null);
$limit = param_integer('limit', 100);
json_headers();
$data = get_institutional_admin_search_results($params, $limit);
$data['error'] = false;
$data['message'] = null;
echo json_encode($data);
exit;
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:29,代码来源:userinstitutionsearch.json.php


示例13: define

<?php

/**
 *
 * @package    mahara
 * @subpackage admin
 * @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('ADMIN', 1);
define('INSTITUTIONALADMIN', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once 'searchlib.php';
$search = (object) array('query' => '', 'sortby' => 'firstname', 'sortdir' => 'asc', 'archivedsubmissions' => true);
$search->institution = param_alphanum('institution', null);
if (!empty($search->institution)) {
    if (!$USER->get('admin') && !$USER->is_institutional_admin($search->institution)) {
        throw new AccessDeniedException();
    }
}
$results = get_admin_user_search_results($search, 0, false);
if (!empty($results['data'])) {
    $csvfields = array('username', 'email', 'firstname', 'lastname', 'preferredname', 'submittedto', 'specialid', 'filetitle', 'filepath', 'filename', 'archivectime');
    $USER->set_download_file(generate_csv($results['data'], $csvfields), 'archivedsubmissions.csv', 'text/csv');
    redirect(get_config('wwwroot') . 'download.php');
}
$SESSION->add_error_msg(get_string('nocsvresults', 'admin'));
redirect(get_config('wwwroot') . 'admin/groups/archives.php?institution=' . $search->institution);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:archivescsvdownload.php


示例14: define

 * @author     Mike Kelly UAL <[email protected]>
 * @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';
require_once 'imagebrowser.php';
$change = param_boolean('change', false);
$viewid = param_integer('id', 0);
$forumpostid = param_integer('post', 0);
$groupid = param_integer('group', 0);
$institution = param_alphanum('institution', 0);
$blogid = param_alphanum('blogid', 0);
$fileid = param_alphanum('selected', null);
$changebrowsetab = param_integer('imgbrowserconf_artefactid_changeowner', 0);
// Folder value is 0 when returning to Home folder
$changefolder = param_exists('imgbrowserconf_artefactid_changefolder') ? true : false;
$uploadimg = param_integer('imgbrowserconf_artefactid_upload', 0);
$formsubmit = param_exists('action_submitimage') ? true : false;
$formcancel = param_exists('cancel_action_submitimage') ? true : false;
if ($forumpostid && !$groupid) {
    $sql = "SELECT g.id\n                FROM {group} g\n                INNER JOIN {interaction_instance} ii ON ii.group = g.id\n                INNER JOIN {interaction_forum_topic} ift ON ift.forum = ii.id\n                INNER JOIN {interaction_forum_post} ifp ON ifp.topic = ift.id\n                WHERE ifp.id = ?\n                AND ifp.deleted = 0";
    $groupid = get_field_sql($sql, array($forumpostid));
}
if ($blogid) {
    safe_require('artefact', 'blog');
    $blogobj = new ArtefactTypeBlog($blogid);
    $institution = $blogobj->get('institution');
    $institution = !empty($institution) ? $institution : 0;
开发者ID:sarahjcotton,项目名称:mahara,代码行数:31,代码来源:imagebrowser.json.php


示例15: define

 * @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';
require_once get_config('libroot') . 'view.php';
$group = param_integer('group', null);
$institution = param_alphanum('institution', null);
$views = new StdClass();
$views->query = trim(param_variable('viewquery', ''));
$views->ownerquery = trim(param_variable('ownerquery', ''));
$views->offset = param_integer('viewoffset', 0);
$views->limit = param_integer('viewlimit', 10);
$views->group = param_integer('group', null);
$views->institution = param_alphanum('institution', null);
$views->copyableby = (object) array('group' => $group, 'institution' => $institution);
if (!($group || $institution)) {
    $views->copyableby->owner = $USER->get('id');
}
$searchcollection = param_integer('searchcollection', null);
$sort[] = array('column' => 'title', 'desc' => 0);
if ($searchcollection) {
    array_unshift($sort, array('column' => 'collection', 'desc' => 0, 'tablealias' => 'cv'));
    $views->collection = $searchcollection;
}
$views->sort = (object) $sort;
View::get_templatesearch_data($views);
json_reply(false, array('message' => null, 'data' => array('table' => $views->html, 'pagination' => $views->pagination['html'], 'count' => $views->count)));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:templatesearch.json.php


示例16: define

/**
 *
 * @package    mahara
 * @subpackage interaction-forum
 * @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/forums');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
$forum = $topic = 0;
$key = param_alphanum('key', '');
$subscriptiontype = 'forum';
$forum = param_integer('forum', 0);
if (!$forum) {
    $subscriptiontype = 'topic';
    $topic = param_integer('topic');
}
$goto = $USER->is_logged_in() ? $subscriptiontype == 'forum' ? '/interaction/forum/view.php?id=' . $forum : '/interaction/forum/topic.php?id=' . $topic : '/index.php';
if ($key || $USER->is_logged_in()) {
    // get record from forum subscriptions for this key
    if ($key) {
        $subscription = get_record('interaction_forum_subscription_' . $subscriptiontype, 'key', $key);
    } else {
        $subscription = get_record('interaction_forum_subscription_' . $subscriptiontype, 'user', $USER->get('id'), $subscriptiontype, ${$subscriptiontype});
    }
    if (!$subscription) {
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:unsubscribe.php


示例17: define

 */
define('INTERNAL', 1);
define('MENUITEM', 'groups');
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('docroot') . 'interaction/lib.php';
require_once 'pieforms/pieform.php';
require_once 'group.php';
$id = param_integer('id', 0);
if (!empty($id)) {
    $instance = interaction_instance_from_id($id);
    $plugin = $instance->get('plugin');
    $groupid = (int) $instance->get('group');
    define('TITLE', get_string('edittitle', 'interaction.' . $plugin));
} else {
    $instance = null;
    $plugin = param_alphanum('plugin');
    $groupid = param_integer('group');
    define('TITLE', get_string('addtitle', 'interaction.' . $plugin));
}
define('GROUP', $groupid);
$group = group_current_group();
safe_require('interaction', $plugin);
$membership = group_user_access($groupid);
if ($membership != 'admin') {
    throw new AccessDeniedException(get_string('notallowedtoeditinteractions', 'group'));
}
$returnto = param_alpha('returnto', 'view');
$elements = array_merge(PluginInteraction::instance_config_base_form($plugin, $group, $instance), call_static_method(generate_class_name('interaction', $plugin), 'instance_config_form', $group, $instance), array('submit' => array('type' => 'submitcancel', 'value' => array(get_string('save'), get_string('cancel')), 'goto' => get_config('wwwroot') . 'interaction/' . $plugin . (isset($instance) && $returnto != 'index' ? '/view.php?id=' . $instance->get('id') : '/index.php?group=' . $groupid))));
$js = call_static_method(generate_class_name('interaction', $plugin), 'instance_config_js', $group, $instance);
// save, validate and cancelhandlers are in interaction/lib.php
$form = pieform(array('name' => 'edit_interaction', 'plugintype' => 'interaction', 'pluginname' => $plugin, 'elements' => $elements));
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:edit.php


示例18: service_users_edit_form

/**
 * Service Users edit form
 *
 * @return html
 */
function service_users_edit_form()
{
    global $THEME, $USER;
    $editicon = 'icon icon-pencil prm';
    $deleteicon = 'icon icon-trash prm text-danger';
    $form = array('name' => 'webservices_users', 'elementclasses' => false, 'successcallback' => 'webservices_users_submit', 'renderer' => 'multicolumntable', 'elements' => array('username' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('username', 'auth.webservice')), 'institution' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('institution')), 'servicename' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('servicename', 'auth.webservice')), 'enabled' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('enabled')), 'wssigenc' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('titlewssigenc', 'auth.webservice')), 'functions' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => get_string('functions', 'auth.webservice')), 'actions' => array('title' => ' ', 'datatable' => true, 'type' => 'html', 'value' => '')));
    $dbusers = get_records_sql_array('SELECT eu.id as id, eu.userid as userid, eu.wssigenc AS wssigenc, eu.externalserviceid as externalserviceid, eu.institution as institution, u.username as username, es.name as name, es.enabled as enabled FROM {external_services_users} AS eu LEFT JOIN {usr} AS u ON eu.userid = u.id LEFT JOIN {external_services} AS es ON eu.externalserviceid = es.id ORDER BY eu.id', array());
    if (!empty($dbusers)) {
        foreach ($dbusers as $user) {
            $dbinstitution = get_record('institution', 'name', $user->institution);
            if ($USER->is_admin_for_user($user->id)) {
                $user_url = get_config('wwwroot') . 'admin/users/edit.php?id=' . $user->userid;
            } else {
                $user_url = get_config('wwwroot') . 'user/view.php?id=' . $user->userid;
            }
            $form['elements']['id' . $user->id . '_username'] = array('value' => '<a href="' . $user_url . '">' . $user->username . '</a>', 'type' => 'html', 'key' => $user->id);
            $form['elements']['id' . $user->id . '_institution'] = array('value' => $dbinstitution->displayname, 'type' => 'html', 'key' => $user->id);
            $form['elements']['id' . $user->id . '_servicename'] = array('value' => $user->name, 'type' => 'html', 'key' => $user->id);
            $form['elements']['id' . $user->id . '_enabled'] = array('value' => $user->enabled == 1 ? display_icon('enabled') : display_icon('disabled'), 'type' => 'html', 'class' => 'center', 'key' => $user->id);
            $form['elements']['id' . $user->id . '_wssigenc'] = array('value' => $user->wssigenc == 1 ? display_icon('enabled') : display_icon('disabled'), 'type' => 'html', 'class' => 'center', 'key' => $user->id);
            $functions = get_records_array('external_services_functions', 'externalserviceid', $user->externalserviceid);
            $function_list = array();
            if ($functions) {
                foreach ($functions as $function) {
                    $dbfunction = get_record('external_functions', 'name', $function->functionname);
                    $function_list[] = '<a href="' . get_config('wwwroot') . 'webservice/wsdoc.php?id=' . $dbfunction->id . '">' . $function->functionname . '</a>';
                }
            }
            $form['elements']['id' . $user->id . '_functions'] = array('value' => implode(', ', $function_list), 'type' => 'html', 'key' => $user->id);
            // edit and delete buttons
            $form['elements']['id' . $user->id . '_actions'] = array('value' => pieform(array('name' => 'webservices_user_edit_' . $user->id, 'renderer' => 'div', 'elementclasses' => false, 'successcallback' => 'webservices_user_submit', 'class' => 'form-as-button pull-left', 'jsform' => false, 'elements' => array('suid' => array('type' => 'hidden', 'value' => $user->id), 'action' => array('type' => 'hidden', 'value' => 'edit'), 'submit' => array('type' => 'button', 'usebuttontag' => true, 'class' => 'btn-default btn-sm', 'value' => '<span class="' . $editicon . '"></span>' . get_string('edit'), 'elementtitle' => get_string('editspecific', 'mahara', $user->username))))) . pieform(array('name' => 'webservices_user_delete_' . $user->id, 'renderer' => 'div', 'elementclasses' => false, 'successcallback' => 'webservices_user_submit', 'class' => 'form-as-button pull-left', 'jsform' => false, 'elements' => array('suid' => array('type' => 'hidden', 'value' => $user->id), 'action' => array('type' => 'hidden', 'value' => 'delete'), 'submit' => array('type' => 'button', 'usebuttontag' => true, 'class' => 'btn-default btn-sm', 'value' => '<span class="' . $deleteicon . '"></span>' . get_string('delete'), 'elementtitle' => get_string('deletespecific', 'mahara', $user->username))))), 'type' => 'html', 'key' => $user->id, 'class' => 'webserviceconfigcontrols btn-group');
        }
    } else {
        // no results so hide headings
        $form['elements'] = array();
    }
    $username = '';
    if ($user = param_integer('user', 0)) {
        $dbuser = get_record('usr', 'id', $user);
        if (!empty($dbuser)) {
            $username = $dbuser->username;
        }
    } else {
        $username = param_alphanum('username', '');
    }
    $pieform = new pieform($form);
    return $pieform->build(false) . '<div id="user_add">' . pieform(array('name' => 'webservices_user_generate', 'renderer' => 'div', 'successcallback' => 'webservices_user_submit', 'jsform' => false, 'action' => get_config('wwwroot') . 'webservice/admin/index.php', 'elements' => array('userid' => array('type' => 'autocomplete', 'title' => get_string('username') . ': ', 'ajaxurl' => get_config('wwwroot') . 'webservice/admin/users.json.php', 'multiple' => true, 'allowclear' => true, 'ajaxextraparams' => array(), 'extraparams' => array('maximumSelectionLength' => 1), 'width' => '280px'), 'action' => array('type' => 'hidden', 'value' => 'add'), 'submit' => array('type' => 'submit', 'class' => 'submit btn-primary last', 'value' => get_string('add'))))) . '</div>';
}
开发者ID:patkira,项目名称:mahara,代码行数:53,代码来源:index.php


示例19: define


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP param_alphanumext函数代码示例发布时间:2022-05-15
下一篇:
PHP param_alpha函数代码示例发布时间: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