本文整理汇总了PHP中AMP_url_update函数的典型用法代码示例。如果您正苦于以下问题:PHP AMP_url_update函数的具体用法?PHP AMP_url_update怎么用?PHP AMP_url_update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AMP_url_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_authen_credentials
function check_authen_credentials()
{
// First check for an existing authentication token.
if (isset($_COOKIE[$this->_cookie_name])) {
$this->notice('cookie exists');
if ($result = $this->_handler->check_cookie($_COOKIE[$this->_cookie_name])) {
return $result;
}
}
//Check for a temporary auth token
if (isset($_GET[$this->_cookie_name]) && isset($_GET['authtype']) && $_GET['authtype'] == 'temp') {
if ($result = $this->_handler->check_cookie($_GET[$this->_cookie_name])) {
$cookie_bits = explode(':', $_GET[$this->_cookie_name]);
$hash = $cookie_bits[0];
$this->_handler->set_authen_tokens();
$this->_dbcon->Execute('DELETE FROM users_sessions where hash=' . $this->_dbcon->qstr($hash));
if (isset($_GET['auth_action']) && $_GET['auth_action'] == 'reset') {
trigger_error('redirecting to :' . AMP_url_update('/system/' . AMP_SYSTEM_URL_USER, array('id' => $this->_handler->userid, 'action' => 'reset')));
ampredirect(AMP_url_update('/system/' . AMP_SYSTEM_URL_USER, array('id' => $this->_handler->userid, 'action' => 'reset')));
exit;
}
return $result;
}
}
if (isset($_REQUEST[$this->_login_username_field]) || isset($_SERVER['PHP_AUTH_USER'])) {
$this->notice('checking password');
return $this->_handler->check_password();
}
$this->error('neither cookie nor password found');
return false;
}
示例2: get_url_edit
function get_url_edit()
{
if (!(isset($this->id) && $this->id)) {
return AMP_SYSTEM_URL_FAQ;
}
return AMP_url_update(AMP_SYSTEM_URL_FAQ, array('id' => $this->id));
}
示例3: nav_articles_by_date
function nav_articles_by_date()
{
$page =& AMPContent_Page::instance();
if ($class = $page->getClassId()) {
$date_values = AMP_lookup('classArticlesByDate', $class);
} else {
$date_values = AMP_lookup('articlesByDate');
}
if (!$date_values) {
return false;
}
$output = array();
$renderer = AMP_get_renderer();
foreach ($date_values as $pretty_date => $qty) {
$real_date = strtotime($pretty_date);
$url['year'] = date('Y', $real_date);
$url['month'] = date('m', $real_date);
$url['offset'] = false;
$url['qty'] = false;
$new_url = AMP_url_update($_SERVER['REQUEST_URI'], $url);
$output[] = $renderer->link($new_url, $pretty_date, array('class' => AMP_CONTENT_CSS_CLASS_NAV_LINK));
if (count($output) == AMP_CONTENT_NAV_ARCHIVE_LIMIT) {
break;
}
}
return join($renderer->newline(), $output);
}
示例4: onDelete
function onDelete(&$controller, $args = array())
{
$model = $controller->get_model();
$nav_layout = $model->getLayoutId();
if ($nav_layout) {
ampredirect(AMP_url_update(AMP_SYSTEM_URL_NAV_LAYOUT, array('id' => $nav_layout)));
}
}
示例5: temp_auth_actions
function temp_auth_actions()
{
if (isset($_GET['auth_action']) && $_GET['auth_action'] == 'reset') {
trigger_error('redirecting to :' . AMP_url_update('/system/' . AMP_SYSTEM_URL_USER, array('id' => $this->_handler->userid, 'action' => 'reset')));
ampredirect(AMP_url_update('/system/' . AMP_SYSTEM_URL_USER, array('id' => $this->_handler->userid, 'action' => 'reset')));
exit;
}
}
示例6: render_url_for_scaled
function render_url_for_scaled($source, $width_limit)
{
if ($source->width <= $width_limit) {
return $this->render_url_for($source);
}
$img_class = end(split(DIRECTORY_SEPARATOR, dirname($source->getPath())));
return AMP_url_update(AMP_CONTENT_URL_IMAGE, array('filename' => $source->getName(), 'class' => $img_class, 'action' => 'resize', 'width' => $width_limit));
}
示例7: buildUrlArray
function buildUrlArray()
{
foreach ($this->section_keys as $id) {
$this->urls[] = AMP_url_update(AMP_CONTENT_URL_LIST_SECTION, array('type' => $id));
}
foreach ($this->article_keys as $id) {
$this->urls[] = AMP_url_update(AMP_CONTENT_URL_ARTICLE, array('id' => $id));
}
}
示例8: get_url_edit
function get_url_edit()
{
$badge = $this->getBadgeId();
if ($badge) {
return AMP_url_update(AMP_SYSTEM_URL_BADGE, array('id' => $badge));
}
$nav = $this->getNavId();
if ($nav) {
return AMP_url_update(AMP_SYSTEM_URL_NAV, array('id' => $nav));
}
return false;
}
示例9: render_sections
function render_sections($source)
{
$section_list = $this->load_live_sections($source);
$sections = array();
foreach ($section_list as $section_id => $section_name) {
$sections[] = $this->_renderer->link(AMP_url_update(AMP_CONTENT_URL_LIST_CLASS, array('type' => $section_id, 'class' => AMP_CONTENT_CLASS_BLOG)), $section_name);
}
$result = join(", ", $sections);
if (!$result) {
return false;
}
return AMP_TEXT_POSTED_IN . $this->_renderer->space() . $result;
}
示例10: _dbEdit
function _dbEdit($source, $column_name)
{
$db_images = AMP_lookup('db_images');
if (!$db_images) {
return false;
}
$image_db_id = array_search($source->getName(), $db_images);
if ($image_db_id === FALSE) {
return false;
}
$renderer =& $this->_getRenderer();
return $renderer->link(AMP_url_update(AMP_SYSTEM_URL_IMAGES, array('id' => $image_db_id)), AMP_TEXT_EDIT);
}
示例11: render_nav_links
function render_nav_links($data, $fieldname)
{
if (!(isset($data['id']) && $data['id'])) {
return false;
}
$linked_navs = AMP_lookup('navs_by_badge', $data['id']);
if (!$linked_navs) {
return false;
}
$renderer = AMP_get_renderer();
foreach ($linked_navs as $id => $name) {
$links[$id] = $renderer->link(AMP_url_update(AMP_SYSTEM_URL_NAV, array('id' => $id)), $name);
}
return 'Linked Navs:' . $renderer->UL($links);
}
示例12: link_to_layouts
function link_to_layouts($data, $fieldname)
{
if (!(isset($data['id']) && $data['id'])) {
return false;
}
$linked_layouts = AMP_lookup('nav_layouts_by_nav', $data['id']);
if (!$linked_layouts) {
return false;
}
$renderer = AMP_get_renderer();
asort($linked_layouts);
foreach ($linked_layouts as $id => $name) {
if (!$name) {
continue;
}
$links[$id] = $renderer->link(AMP_url_update(AMP_SYSTEM_URL_NAV_LAYOUT, array('id' => $id)), $name);
}
return 'Used in Layouts:' . $renderer->UL($links, array('class' => 'linked_items'));
}
示例13: _init_criteria
function _init_criteria()
{
if (!isset($this->_pager)) {
return;
}
$pager_target = false;
$section = isset($this->_source_criteria['section']) && $this->_source_criteria['section'] && !is_array($this->_source_criteria['section']) ? $this->_source_criteria['section'] : false;
$class = isset($this->_source_criteria['class']) && $this->_source_criteria['class'] && !is_array($this->_source_criteria['class']) ? $this->_source_criteria['class'] : false;
if ($section && $class) {
$pager_target = AMP_url_update(AMP_CONTENT_URL_LIST_CLASS, array('type' => $section, 'class' => $class));
} elseif ($section) {
$pager_target = AMP_url_update(AMP_CONTENT_URL_LIST_SECTION, array('type' => $section));
} elseif ($class) {
$pager_target = AMP_url_update(AMP_CONTENT_URL_LIST_CLASS, array('class' => $class));
}
if ($pager_target) {
$this->_pager->set_target($pager_target);
}
}
示例14: restore
function restore()
{
$target_id = $this->getData('id');
if (!$target_id) {
return false;
}
require_once 'AMP/Content/Template.inc.php';
$template =& new AMPContent_Template($this->dbcon, $target_id);
$template->save_version();
$template->mergeData($this->getData());
$result = $template->save();
if (!$result) {
return false;
}
AMP_flush_common_cache();
$flash =& AMP_System_Flash::instance();
$flash->add_message(sprintf(AMP_TEXT_DATA_RESTORE_SUCCESS, $this->getName()));
ampredirect(AMP_url_update(AMP_SYSTEM_URL_TEMPLATE, array('id' => $target_id)));
return $result;
}
示例15: _make_event_list_field
function _make_event_list_field()
{
$uid = $this->udm->uid;
if (!$uid) {
$uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : false;
}
if (!$uid) {
return;
}
$events = AMP_lookup('eventsByOwner', $uid);
if (!$events) {
return;
}
$event_list = '';
$renderer = AMP_get_renderer();
foreach ($events as $event_id => $event_name) {
$event_list .= $renderer->link(AMP_url_update(AMP_SYSTEM_URL_EVENT, array('id' => $event_id)), $event_name) . $renderer->newline();
}
$this->fields['events_list'] = array('type' => 'static', 'enabled' => true, 'default' => $event_list, 'public' => false);
$this->fields['events_list_header'] = array('type' => 'header', 'label' => 'All Events Created By this User', 'public' => false, 'enabled' => true);
$this->insertAfterFieldOrder(array('events_list_header', 'events_list'));
}