本文整理汇总了PHP中param_alphanum函数的典型用法代码示例。如果您正苦于以下问题:PHP param_alphanum函数的具体用法?PHP param_alphanum怎么用?PHP param_alphanum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了param_alphanum函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)) {
示例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') . ' ' . $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':
//.........这里部分代码省略.........
示例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';
}
示例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();
//.........这里部分代码省略.........
示例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)) {
示例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);
示例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;
示例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();
示例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));
示例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 {
示例11: define
* @subpackage artefact-survey
* @author Gregor Anzelj
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2010-2011 Gregor Anzelj <gregor.anzelj@gmail.com>
*
*/
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'));
示例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;
示例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);
示例14: define
* @author Mike Kelly UAL <m.f.kelly@arts.ac.uk>
* @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;
示例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)));