本文整理汇总了PHP中Get类的典型用法代码示例。如果您正苦于以下问题:PHP Get类的具体用法?PHP Get怎么用?PHP Get使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Get类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modglossarygui
function modglossarygui($object_glos = NULL)
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('glossary');
require_once _base_ . '/lib/lib.table.php';
$tableGlossary = new Table(Get::sett('visuItem'), '', $lang->def('_GLOSSARY_SUMMARY'));
$tableGlossary->initNavBar('ini', 'link');
$ini = $tableGlossary->getSelectedElement();
$back_coded = htmlentities(urlencode($object_glos->back_url));
list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossary \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
$reTerm = sql_query("\r\n\tSELECT idTerm, term \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "' \r\n\tORDER BY term \r\n\tLIMIT {$ini}," . Get::sett('visuItem'));
list($num_of_term) = sql_fetch_row(sql_query("\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm\r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
if ($title == '') {
$_SESSION['last_error'] = $lang->def('_FILEUNSPECIFIED');
Util::jump_to(Util::str_replace_once('&', '&', $object_glos->back_url) . '&create_result=0');
}
$GLOBALS['page']->add(getTitleArea($lang->def('_GLOSSARY'), 'glossary', $lang->def('_GLOSSARY')) . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_glos->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_GLOSSARY') . ' : ' . $title . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=glossary&op=modglossary&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD_TITLE') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD_TITLE') . '</a>' . '</div><br />', 'content');
$contentArray = array($lang->def('_TERM'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />');
$typeArray = array('', 'image', 'image');
$GLOBALS['page']->add($tableGlossary->addHead($contentArray, $typeArray));
while (list($idTerm, $term) = sql_fetch_row($reTerm)) {
$content = array($term, '<a href="index.php?modname=glossary&op=modterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /></a>', '<a href="index.php?modname=glossary&op=delterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_DEL') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>');
$tableGlossary->addBody($content);
}
$tableGlossary->addActionAdd('<a href="index.php?modname=glossary&op=addterm&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDTERM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDTERM') . '</a>');
$tableGlossary->setLink('index.php?modname=glossary&op=modglossarygui' . '&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded);
$GLOBALS['page']->add($tableGlossary->getTable() . $tableGlossary->getNavBar($ini, $num_of_term) . '</div>', 'content');
}
示例2: init
public function init()
{
$this->id_date = Get::req('id_date', DOTY_INT, 0);
$this->model = new PresenceLms($_SESSION['idCourse'], $this->id_date);
$this->json = new Services_JSON();
$this->permissions = array('view' => true);
}
示例3: getInstance
/**
* Returns an singleton instance of this class
* @return
*/
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new Get();
}
return self::$instance;
}
示例4: drawCalendar
function drawCalendar()
{
checkPerm('view');
$size = importVar('size', false, 'max');
$width = "90%";
if ($size == "min") {
$width = "200px";
}
addCss('calendar_' . $size);
YuiLib::load('base,dragdrop');
Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true);
Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true);
//permissions = permissions granted to the logged user according to his/her level and role
// 2 => can create/delete/modify all events
// 1 => can create/delete/modify only own events
// 0 => can view only
$permissions = 0;
if (checkPerm('mod', true)) {
$permissions = 2;
} elseif (checkPerm('personal', true)) {
$permissions = 1;
}
//mode="edit" => events can be added and edited according to given permissions
//mode="view" => events can only be viewed regardless the permissions
$GLOBALS['page']->add('<script type="text/javascript">' . ' setup_cal( null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head');
$GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content');
}
示例5: show
function show()
{
global $page, $db, $user, $fs, $proj;
$page->setTitle($fs->prefs['page_title'] . L('reports'));
$events = array(1 => L('taskopened'), 13 => L('taskreopened'), 2 => L('taskclosed'), 3 => L('taskedited'), 14 => L('assignmentchanged'), 29 => L('events.useraddedtoassignees'), 4 => L('commentadded'), 5 => L('commentedited'), 6 => L('commentdeleted'), 7 => L('attachmentadded'), 8 => L('attachmentdeleted'), 11 => L('relatedadded'), 12 => L('relateddeleted'), 9 => L('notificationadded'), 10 => L('notificationdeleted'), 17 => L('reminderadded'), 18 => L('reminderdeleted'));
$user_events = array(30 => L('created'), 31 => L('deleted'));
$page->assign('events', $events);
$page->assign('user_events', $user_events);
$sort = strtoupper(Get::enum('sort', array('desc', 'asc')));
$where = array();
$params = array();
$orderby = '';
switch (Get::val('order')) {
case 'type':
$orderby = "h.event_type {$sort}, h.event_date {$sort}";
break;
case 'user':
$orderby = "user_id {$sort}, h.event_date {$sort}";
break;
case 'date':
default:
$orderby = "h.event_date {$sort}, h.event_type {$sort}";
}
foreach (Get::val('events', array()) as $eventtype) {
$where[] = 'h.event_type = ?';
$params[] = $eventtype;
}
$where = '(' . implode(' OR ', $where) . ')';
if ($proj->id) {
$where = $where . 'AND (t.project_id = ? OR h.event_type > 29) ';
$params[] = $proj->id;
}
if (($fromdate = Req::val('fromdate')) || Req::val('todate')) {
$where .= ' AND ';
$todate = Req::val('todate');
if ($fromdate) {
$where .= ' h.event_date > ?';
$params[] = Flyspray::strtotime($fromdate) + 0;
}
if ($todate && $fromdate) {
$where .= ' AND h.event_date < ?';
$params[] = Flyspray::strtotime($todate) + 86400;
} else {
if ($todate) {
$where .= ' h.event_date < ?';
$params[] = Flyspray::strtotime($todate) + 86400;
}
}
}
$histories = array();
if (count(Get::val('events'))) {
if (Get::num('event_number') > 0) {
$db->setLimit(Get::num('event_number'));
}
$histories = $db->x->getAll("SELECT h.*, t.*, p.project_prefix\n FROM {history} h\n LEFT JOIN {tasks} t ON h.task_id = t.task_id\n LEFT JOIN {projects} p ON t.project_id = p.project_id\n WHERE {$where}\n ORDER BY {$orderby}", null, $params);
}
$page->assign('histories', $histories);
$page->assign('sort', $sort);
$page->pushTpl('reports.tpl');
}
示例6: showTask
public function showTask()
{
$model = new SettingAdm();
$regroup = $model->getRegroupUnit();
$active_tab = Get::req('active_tab', DOTY_MIXED, 1);
$this->render('show', array('model' => $model, 'regroup' => $regroup, 'active_tab' => $active_tab));
}
示例7: load
/**
* Load css and yui file
* @return null
* @param $js Array[optional]
* @param $css Array[optional]
*/
public static function load($module_list = false, $noprint = false)
{
$module_list = 'base,autocomplete,charts,tabview,table,treeview,colorpicker';
if (strpos($module_list, 'base') !== false) {
$module_list = 'base,' . $module_list;
}
$list = explode(',', $module_list);
$js_load = array();
$css_load = array();
foreach ($list as $k => $module) {
if (isset(self::$_css_map[$module])) {
$css_load = array_unique(array_merge($css_load, self::$_css_map[$module]));
}
if (isset(self::$_js_map[$module])) {
$js_load = array_unique(array_merge($js_load, self::$_js_map[$module]));
}
}
// remove js alredy loaded
$css_load = array_diff($css_load, self::$_css_loaded);
$js_load = array_diff($js_load, self::$_js_loaded);
if (empty($css_load) && empty($js_load)) {
return '';
}
// load new css
$to_load = '';
if (!empty($css_load)) {
$to_load .= '<!-- yui css -->';
foreach ($css_load as $k => $filename) {
$to_load .= Util::get_css(Get::tmpl_path('base') . 'yui-skin/' . $filename, true);
}
}
// load new js
if (!empty($js_load)) {
$to_load .= '<!-- yui js -->';
foreach ($js_load as $k => $filename) {
$to_load .= Util::get_js('/addons/yui/' . $filename);
if ($filename == 'utilities/utilities.js') {
$to_load .= "\n" . '<script type="text/javascript"> YAHOO.util.Connect.initHeader(\'X-Signature\',\'' . Util::getSignature() . '\'); YAHOO.util.Connect.startEvent.subscribe(function() { YAHOO.util.Connect.initHeader(\'X-Signature\',\'' . Util::getSignature() . '\'); });</script>';
}
if ($filename == 'charts/charts-min.js') {
$to_load .= "\n" . '<script type="text/javascript"> YAHOO.widget.Chart.SWFURL = "' . Get::rel_path('base') . '/addons/yui/charts/assets/charts.swf"; </script>';
}
}
if (Lang::direction() == 'rtl') {
$to_load .= Util::get_js('/addons/yui/yui-rtl.js');
}
}
// add loaded file to the cache
if (!empty($css_load)) {
self::$_css_loaded = array_merge(self::$_css_loaded, $css_load);
}
if (!empty($js_load)) {
self::$_js_loaded = array_merge(self::$_js_loaded, $js_load);
}
if (function_exists('cout') && !$noprint) {
cout($to_load, 'page_head');
} else {
return $to_load;
}
}
示例8: tagslist
function tagslist()
{
require_once _base_ . '/lib/lib.table.php';
require_once $GLOBALS['where_framework'] . '/lib/lib.tags.php';
$lang =& DoceboLanguage::createInstance('tags', 'framework');
$id_tag = Get::req('id_tag', DOTY_INT, 0);
$tag_name = Get::req('tag', DOTY_STRING, '');
$filter = Get::req('filter', DOTY_STRING, '');
$nav_bar = new NavBar('ini', Get::sett('visuItem'), 0);
$nav_bar->setLink('index.php?modname=tags&op=tags&id_tag=' . $id_tag);
$ini = $nav_bar->getSelectedElement();
$tags = new Tags('*');
$resources = $tags->getResourceByTags($id_tag, false, false, $ini, Get::sett('visuItem'));
$GLOBALS['page']->add(getTitleArea(array($lang->def('_TAGS')), 'tags') . '<div class="std_block">' . '<div class="tag_list">', 'content');
while (list(, $res) = each($resources['list'])) {
$link = $res['permalink'];
$delim = strpos($link, '?') === false ? '?' : '&';
if (strpos($link, '#') === false) {
$link = $link . $delim . 'sop=setcourse&sop_idc=' . $res['id_course'];
} else {
$link = str_replace('#', $delim . 'sop=setcourse&sop_idc=' . $res['id_course'] . '#', $link);
}
$GLOBALS['page']->add('' . '<h2>' . '<a href="' . $link . '">' . $res['title'] . '</a>' . '</h2>' . '<p>' . $res['sample_text'] . '</p>' . '<div class="tag_cloud">' . '<span>' . $lang->def('_TAGS') . ' : </span>' . '<ul><li>' . implode('</li><li>', $res['related_tags']) . '</li></ul>' . '</div>' . '<br />', 'content');
}
$GLOBALS['page']->add('</div>' . $nav_bar->getNavBar($ini, $resources['count']) . '</div>', 'content');
}
示例9: validate
public function validate()
{
$_SESSION['adm_info'] = Get::pReq('adm_info');
$_SESSION['lang_install'] = Get::pReq('lang_install');
$this->saveConfig();
return true;
}
示例10: getTransaction
public function getTransaction($start_index, $results, $sort, $dir, $filter = false)
{
$query = "SELECT t.id_trans, t.date_creation, t.date_activated, t.paid, SUM(ti.price) as price, u.userid, u.firstname, u.lastname" . " FROM %adm_transaction as t" . " JOIN %adm_transaction_info as ti ON t.id_trans = ti.id_trans" . " JOIN %adm_user as u ON t.id_user = u.idst" . " WHERE 1";
$query .= " GROUP BY t.id_trans";
switch ($sort) {
case 'userid':
$query .= " ORDER BY u.userid " . $dir;
break;
case 'firstname':
$query .= " ORDER BY u.firstname " . $dir;
break;
case 'lastname':
$query .= " ORDER BY u.lastname " . $dir;
break;
case 'date_creation':
$query .= " ORDER BY t.date_creation " . $dir;
break;
case 'date_activated':
$query .= " ORDER BY t.date_activated " . $dir;
break;
}
$start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results);
$result = sql_query($query);
$res = array();
while ($row = sql_fetch_assoc($result)) {
$row['userid'] = $this->acl_man->relativeId($row['userid']);
$row['date_creation'] = Format::date($row['date_creation'], 'datetime');
$row['date_activated'] = Format::date($row['date_activated'], 'datetime');
$row['paid'] = $row['paid'] == 1 ? Get::img('standard/status_active.png', Lang::t('_ACTIVATED', 'transaction')) : Get::img('standard/status_deactive.png', Lang::t('_NOT_ACTIVATED', 'transaction'));
$row['edit'] = '<a href="index.php?r=alms/transaction/mod&id_trans=' . $row['id_trans'] . '" title="' . Lang::t('_MOD', 'transaction') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')) . '</a>';
$res[] = $row;
}
return $res;
}
示例11: _resolveOrder
/**
* This function return the correct order to use when you wish to diplay the a
* course list for the user.
* @param <array> $t_name the table name to use as a prefix for the field, if false is passed no prefix will e used
* we need a prefix for the course user rows and a prefix for the course table
* array('u', 'c')
* @return <string> the order to use in a ORDER BY clausole
*/
protected function _resolveOrder($t_name = array('', ''))
{
// read order for the course from database
if ($this->_t_order == false) {
$t_order = Get::sett('tablist_mycourses', false);
if ($t_order != false) {
$arr_order_course = explode(',', $t_order);
$arr_temp = array();
foreach ($arr_order_course as $key => $value) {
switch ($value) {
case 'status':
$arr_temp[] = ' ?u.status ';
break;
case 'code':
$arr_temp[] = ' ?c.code ';
break;
case 'name':
$arr_temp[] = ' ?c.name ';
break;
}
}
$t_order = implode(', ', $arr_temp);
} else {
$t_order = '?u.status, ?c.name';
}
// save a class copy of the resolved list
$this->_t_order = $t_order;
}
foreach ($t_name as $key => $value) {
if ($value != '') {
$t_name[$key] = $value . '.';
}
}
return str_replace(array('?u.', '?c.'), $t_name, $this->_t_order);
}
示例12: tpl_list_heading
function tpl_list_heading($colname, $format = "<th%s>%s</th>")
{
global $proj, $page;
$imgbase = '<img src="%s" alt="%s" />';
$class = '';
$html = eL($colname);
if ($colname == 'comments' || $colname == 'attachments') {
$html = sprintf($imgbase, $page->get_image(substr($colname, 0, -1)), $html);
}
if (Get::val('order') == $colname) {
$class = ' class="orderby"';
$sort1 = Get::safe('sort', 'desc') == 'desc' ? 'asc' : 'desc';
$sort2 = Get::safe('sort2', 'desc');
$order2 = Get::safe('order2');
$html .= ' ' . sprintf($imgbase, $page->get_image(Get::val('sort')), Get::safe('sort'));
} else {
$sort1 = 'desc';
if (in_array($colname, array('project', 'tasktype', 'category', 'openedby', 'assignedto'))) {
$sort1 = 'asc';
}
$sort2 = Get::safe('sort', 'desc');
$order2 = Get::safe('order');
}
$new_order = array('order' => $colname, 'sort' => $sort1, 'order2' => $order2, 'sort2' => $sort2);
$html = sprintf('<a title="%s" href="%s">%s</a>', eL('sortthiscolumn'), Filters::noXSS(CreateURL('index', $proj->id, null, array_merge($_GET, $new_order))), $html);
return sprintf($format, $class, $html);
}
示例13: loadBody
function loadBody()
{
switch ($GLOBALS['op']) {
case 'showresults':
$id_course = Get::req('id_course', DOTY_INT, false);
$_SESSION['idCourse'] = $id_course;
Util::jump_to('index.php?modname=organization&op=showresults&idcourse=' . $id_course);
break;
case "mycourses":
case "unregistercourse":
require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/course.php';
require_once _base_ . '/lib/lib.urlmanager.php';
$url =& UrlManager::getInstance('course');
$url->setStdQuery('r=' . _after_login_);
mycourses($url);
break;
case "donwloadmaterials":
downloadMaterials();
break;
default:
require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/infocourse.php';
infocourseDispatch($GLOBALS['op']);
break;
}
}
示例14: do_private_post
function do_private_post($content, $results)
{
global $config, $speak;
$results = Mecha::O($results);
$results = $config->is->post ? Get::postHeader($results->path, POST . DS . $config->page_type, '/', $config->page_type . ':') : false;
if ($results === false) {
return $speak->plugin_private_post->description;
}
$s = isset($results->fields->pass) ? $results->fields->pass : "";
if (strpos($s, ':') !== false) {
$s = explode(':', $s, 2);
if (isset($s[1])) {
$speak->plugin_private_post->hint = ltrim($s[1]);
}
// override password hint
$s = $s[0];
}
$hash = md5($s . PRIVATE_POST_SALT);
$html = Notify::read(false) . '<div class="overlay--' . File::B(__DIR__) . '"></div><form class="form--' . File::B(__DIR__) . '" action="' . $config->url . '/' . File::B(__DIR__) . '/do:access" method="post">' . NL;
$html .= TAB . Form::hidden('token', Guardian::token()) . NL;
$html .= TAB . Form::hidden('_', $hash) . NL;
$html .= TAB . Form::hidden('kick', $config->url_current) . NL;
$html .= TAB . '<p>' . $speak->plugin_private_post->hint . '</p>' . NL;
$html .= TAB . '<p>' . Form::text('access', "", $speak->password . '…', array('autocomplete' => 'off')) . ' ' . Form::button($speak->submit, null, 'submit') . '</p>' . NL;
$html .= '</form>' . O_END;
if ($results && isset($results->fields->pass) && trim($results->fields->pass) !== "") {
if (!Guardian::happy() && Session::get('is_allow_post_access') !== $hash) {
return $html;
}
}
return $content;
}
示例15: getBoxContent
function getBoxContent()
{
$html = array();
if (!checkPerm('view_org_chart', true, 'directory', 'framework')) {
return $html;
}
require_once _base_ . '/lib/lib.userselector.php';
$user_dir = new UserSelector();
$user_stats = $user_dir->getUsersStats();
$lang =& DoceboLanguage::createInstance('dashboard', 'framework');
if (Get::sett('welcome_use_feed') == 'on') {
require_once _base_ . '/lib/lib.fsock_wrapper.php';
$fp = new Fsock();
$released_version = $fp->send_request('http://www.formalms.org/versions/release.txt');
if (!$fp) {
$released_version = '<strong class="old_release">' . $lang->def('_UNKNOWN_RELEASE') . '</strong>';
} else {
if ($released_version == false) {
$released_version = '<strong class="ok_release">' . $lang->def('_UNKNOWN_RELEASE') . '</strong>';
}
if ($released_version == Get::sett('core_version')) {
$released_version = '<strong class="ok_release">' . $released_version . '</strong>';
} else {
$released_version = '<strong class="old_release">' . $released_version . ' (' . $lang->def('_NEW_RELEASE_AVAILABLE') . ')</strong>';
}
}
}
$html[] = '<h2 class="inline">' . $lang->def('_USERS_PANEL') . '</h2>' . '<p>' . $lang->def('_TOTAL_USER') . ': <b>' . ($user_stats['all'] - 1) . '</b>;<br />' . $lang->def('_SUSPENDED') . ': <b>' . $user_stats['suspended'] . '</b>;<br />' . (checkPerm('approve_waiting_user', true, 'directory', 'framework') ? $lang->def('_WAITING_USERS') . ': <b>' . $user_stats['waiting'] . '</b>;' : '') . '</p><p>' . $lang->def('_SUPERADMIN_USER') . ': <b>' . $user_stats['superadmin'] . '</b>;<br />' . $lang->def('_ADMIN_USER') . ': <b>' . $user_stats['admin'] . '</b>;<br />' . $lang->def('_PUBLIC_ADMIN_USER') . ': <b>' . $user_stats['public_admin'] . '</b>;' . '</p><p>' . $lang->def('_REG_TODAY') . ': <b>' . $user_stats['register_today'] . '</b>;<br />' . $lang->def('_REG_YESTERDAY') . ': <b>' . $user_stats['register_yesterday'] . '</b>;<br />' . $lang->def('_REG_LASTSEVENDAYS') . ': <b>' . $user_stats['register_7d'] . '</b>;' . '</p><p>' . $lang->def('_INACTIVE_USER') . ': <b>' . $user_stats['inactive_30d'] . '</b>;<br />' . $lang->def('_ONLINE_USER') . ': <b>' . $user_stats['now_online'] . '</b>;' . '</p><p>' . $lang->def('_CORE_VERSION') . ': <b>' . Get::sett('core_version') . '</b>;<br />' . (Get::sett('welcome_use_feed') == 'on' ? $lang->def('_LAST_RELEASED') . ': ' . $released_version . ';' : '') . '</p>';
return $html;
}