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

PHP AMP_Registry类代码示例

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

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



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

示例1: amp_badge_tag_cloud

function amp_badge_tag_cloud($options = array())
{
    $qty_set = isset($options['qty_set']) && $options['qty_set'] ? $options['qty_set'] : false;
    if (!$qty_set && !isset($options['section'])) {
        $qty_set = AMP_lookup('tag_totals_articles_by_section_live', AMP_current_section_id());
    }
    if (!$qty_set && !$options['section']) {
        $qty_set = AMP_lookup('tag_totals_articles_live');
    }
    if (!$qty_set && $options['section']) {
        $qty_set = AMP_lookup('tag_totals_articles_by_section_live', $options['section']);
    }
    if (!$qty_set) {
        return false;
    }
    $display_url = isset($options['display_url']) && $options['display_url'] ? $options['display_url'] : false;
    $source_item = new AMP_Content_Tag(AMP_Registry::getDbcon());
    $source = $source_item->find(array('displayable' => 1));
    if (!$source) {
        return false;
    }
    $display = new AMP_Display_Cloud($source, $qty_set);
    if ($display_url) {
        $display->set_url_method($display_url);
    }
    $renderer = AMP_get_renderer();
    return $renderer->div($display->execute(), array('class' => 'tagcloud_badge'));
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:28,代码来源:Tagcloud.php


示例2: _init_class_displays

 function _init_class_displays()
 {
     $class = isset($this->_source_criteria['class']) && $this->_source_criteria['class'] ? $this->_source_criteria['class'] : false;
     if (!($class && is_array($class))) {
         return false;
     }
     $class_display_criteria = $this->_source_criteria;
     // class groups dont show content that also has a tag to be listed
     $tag = isset($this->_source_criteria['tag']) && $this->_source_criteria['tag'] ? $this->_source_criteria['tag'] : false;
     if ($tag && is_array($tag)) {
         unset($class_display_criteria['tag']);
         $class_display_criteria['not_tag'] = $tag;
     }
     require_once 'AMP/Content/Class.inc.php';
     foreach ($class as $class_group) {
         $source = new ContentClass(AMP_Registry::getDbcon(), $class_group);
         $class_display_criteria['class'] = $class_group;
         $class_display = new $this->_grouped_list_class($null = 0, $class_display_criteria, $source->getListItemLimit());
         $class_display->set_container($source);
         $class_display->_class_pager = 'AMP_Display_Pager_Morelinkplus';
         $class_display->_path_pager = 'AMP/Display/Pager/Morelinkplus.php';
         $class_display->set_pager_limit($this->_pager_limit, 'first');
         if (!empty($this->_source_criteria['section'])) {
             $class_display->set_pager_request(array('type' => $this->_source_criteria['section'], 'class' => $class_group, 'list' => 'class'));
         } else {
             $class_display->set_pager_request(array('class' => $class_group, 'list' => 'class'));
         }
         $this->_group_displays['classes'][$class_group] = $class_display;
     }
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:30,代码来源:Grouped.php


示例3: export

 function export(&$target_set, $args = null)
 {
     $sample = current($target_set);
     $keys = $sample->export_keys();
     $dump = array();
     foreach ($keys as $key) {
         $blank_set[$key] = null;
     }
     foreach ($target_set as $source) {
         $values = $source->getData();
         $user_values = array();
         if (isset($values['uid']) && $values['uid']) {
             $owner = new AMP_System_User_Profile(AMP_Registry::getDbcon(), $values['uid']);
             if ($owner->hasData()) {
                 $owner_data = $owner->getData();
                 unset($owner_data['id']);
                 $user_values = array_combine_key($keys, $owner_data);
             }
         }
         $safe_values = array_combine_key($keys, $values);
         $dump[$source->id] = array_merge($blank_set, $safe_values, $user_values);
     }
     require_once 'AMP/Renderer/CSV.php';
     $renderer = new AMP_Renderer_CSV();
     $file = $renderer->format(array($keys));
     $file .= $renderer->format($dump);
     $renderer->header(date("Y_m_d__") . get_class($this));
     print $file;
     exit;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:30,代码来源:Request.inc.php


示例4: amp_badge_related_form

function amp_badge_related_form($data)
{
    $data = array_merge($data, $_GET);
    foreach ($data as $key => $value) {
        if (is_array($value) && count($value) == 1) {
            $quick_val = array_values($value);
            $data[$key] = $quick_val[0];
        }
    }
    $modin = isset($data['modin']) && $data['modin'] ? $data['modin'] : false;
    $related_index = isset($data['related_index']) && $data['related_index'] ? $data['related_index'] : false;
    if (!$modin) {
        return false;
    }
    if (!AMP_authenticate('admin')) {
        $live_forms = AMP_lookup('formsPublic');
        if (!isset($live_forms[$modin])) {
            return 'Please publish the related form';
        }
    }
    require_once 'AMP/UserData.php';
    $udm =& new UserData(AMP_Registry::getDbcon(), $modin);
    $udm->registerPlugin('Output', 'Text');
    $udm->setData($data);
    $renderer = AMP_get_renderer();
    #    $delete_button = $renderer->form(
    $delete_button = $renderer->link('#', $renderer->image(AMP_SYSTEM_ICON_DELETE, array('class' => 'icon', 'style' => 'border: 0;')), array('alt' => AMP_TEXT_DELETE_ITEM, 'title' => AMP_TEXT_DELETE_ITEM, 'onClick' => "\$('form_related_item_{$related_index}').remove( ); \$('form_{$modin}_related_custom_fields_{$related_index}').remove(); return false;"));
    $content = $delete_button . $renderer->tag('pre', $udm->doPlugin('Output', 'Text'));
    $result = $renderer->div($content, array('class' => 'form_related_item', 'id' => 'form_related_item_' . $related_index));
    return $result;
}
开发者ID:radicalsuz,项目名称:amp,代码行数:31,代码来源:RelatedForms.php


示例5: setUp

 function setUp()
 {
     $dbcon = AMP_Registry::getDbcon();
     $this->_udm = new UserDataInput($dbcon, 50, true);
     $this->_plugin = $this->_udm->registerPlugin('AMPCalendar', 'Read');
     $this->_dia_plugin = $this->_udm->registerPlugin('DIAEvent', 'Read');
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:7,代码来源:TestCalendarRead.php


示例6: onDelete

 function onDelete(&$source)
 {
     //delete all versions
     foreach (AMP_lookup('image_classes') as $current_class) {
         $fullpath = AMP_image_path($source->getName(), $current_class);
         if (!file_exists($fullpath)) {
             continue;
         }
         unlink($fullpath);
     }
     //remove gallery records
     require_once 'Modules/Gallery/Image/Set.inc.php';
     $gallerySet =& new GalleryImageSet(AMP_Registry::getDbcon());
     $gallerySet->deleteData($gallerySet->getCriteriaImage($source->getName()));
     $this->_list->removeSourceItemId($source->getName());
     //clear image folder cache
     $this->_update_image_cache_delete($source->getName());
     /*
     $cache = &AMP_get_cache( );
     if ( $cache ) {
         trigger_error( 'attempting cache delete with key ' . $source->getCacheKeySearch( ));
         $cache->delete( $source->getCacheKeySearch( ) );
     }
     */
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:25,代码来源:Observer.inc.php


示例7: saveUserData

function saveUserData()
{
    $json = new Services_JSON();
    $debug = '';
    foreach ($_GET as $key => $value) {
        $debug .= "{$key}: {$value}<br />";
    }
    //Validate incoming User Data
    if ($_GET['Email'] == NULL || $_GET['Email'] == '') {
        $message = array('type' => 'bad', 'text' => 'Please Enter an Email Address');
        $json_data = array('message' => $message, 'debug' => $debug);
        $output = $json->encode($json_data);
        return $output;
    }
    //Save User Data
    $userupdate = new AMP_User_Profile(AMP_Registry::getDbcon(), $_GET['Id']);
    $userdata = array('First_Name' => $_GET['First_Name'], 'Last_Name' => $_GET['Last_Name'], 'Company' => $_GET['Company'], 'Phone' => $_GET['Phone'], 'City' => $_GET['City'], 'Country' => $_GET['Country'], 'custom1' => $_GET['custom1'], 'custom4' => $_GET['custom4'], 'Email' => $_GET['Email']);
    if ($_GET['custom2'] != NULL || $_GET['custom2'] != '') {
        $userdata['custom2'] = $_GET['custom2'];
    }
    $userupdate->mergeData($userdata);
    $success = $userupdate->save();
    //Check to see if save was successful, return
    $json_data = array();
    if ($success == true) {
        $json_data['message'] = array('type' => 'good', 'text' => 'Changes Successfully Saved');
        $json_data['success'] = true;
    } else {
        $json_data['message'] = array('type' => 'bad', 'text' => 'Save Failed');
    }
    $json_data['debug'] = $debug;
    $output = $json->encode($json_data);
    return $output;
}
开发者ID:radicaldesigns,项目名称:winonline,代码行数:34,代码来源:user.submit.php


示例8: assign

 function assign()
 {
     $currentPage =& AMPContent_Page::instance();
     require_once 'AMP/Content/Article.inc.php';
     $crit_builder = new Article(AMP_Registry::getDbcon());
     $this->criteria = $crit_builder->makeCriteriaRelatedSection($currentPage->getSectionId());
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:7,代码来源:Related.inc.php


示例9: setBase

 function setBase($page = "index.php")
 {
     $reg =& AMP_Registry::instance();
     $this->baseURL = "/";
     $this->toplink = $this->baseURL . $page;
     $this->current_section = $this->top;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:7,代码来源:Breadcrumb.inc.php


示例10: _load_target_field_defs

 function _load_target_field_defs()
 {
     require_once 'AMP/UserData.php';
     $udm =& new UserData(AMP_Registry::getDbcon(), $this->_form_id, $admin = true);
     $fields_lookup = array();
     $types_to_avoid = array("html", "static", "header");
     $types_to_group = array('checkgroup', 'multiselect');
     foreach ($udm->fields as $field_name => $field_def) {
         if (!(isset($field_def['enabled']) && $field_def['enabled']) || !isset($field_def['type'])) {
             continue;
         }
         if (array_search($field_def['type'], $types_to_group) !== FALSE) {
             $this->_group_fields[$field_name] = $field_def['label'];
             continue;
         }
         if (array_search($field_def['type'], $types_to_avoid) !== FALSE) {
             continue;
         }
         $label = $field_name;
         if (isset($field_def['label']) && $field_def['label']) {
             $label = $field_def['label'];
         }
         $fields_lookup[$field_name] = $label;
     }
     $fields_lookup['id'] = 'ID';
     require_once 'AMP/System/User/Profile/Profile.php';
     $user =& new AMP_System_User_Profile(AMP_Registry::getDbcon());
     $db_fields = $user->getAllowedKeys();
     foreach ($fields_lookup as $field_key => $field_label) {
         if (!isset($db_fields[strtoupper($field_key)])) {
             unset($fields_lookup[$field_key]);
         }
     }
     $this->_target_fields_lookup = $fields_lookup;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:35,代码来源:ImportForm.php


示例11: Appointment

 function &createAppointment($user, $scheduleItem)
 {
     $dbcon =& AMP_Registry::getDbcon();
     $appointment =& new Appointment($dbcon);
     $appointment->setParticipant($user);
     $appointment->setScheduleItem($scheduleItem);
     return $appointment;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:8,代码来源:Appointment.inc.php


示例12: getLinks

 function getLinks($source = null)
 {
     if (!isset($source)) {
         require_once 'AMP/Content/Link/Link.php';
         $source = new AMP_Content_Link(AMP_Registry::getDbcon());
     }
     $source_set = $source->search($source->makeCriteria(array('linkType' => $this->id)));
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:8,代码来源:Type.php


示例13: get_arguments

 function get_arguments()
 {
     $args = $this->nav->getIncludeFunctionArguments();
     require_once 'AMP/Content/Badge/Badge.php';
     $badge = new AMP_Content_Badge(AMP_Registry::getDbcon());
     $badge->setData(array('include_function_args' => $args));
     return $badge->getIncludeFunctionArguments();
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:8,代码来源:EnginePHP.inc.php


示例14: execute

 function execute()
 {
     $default_feed = new AMPContent_RSSFeed(AMP_Registry::getDbcon());
     $default_feed->setDefaults();
     $default_feed->mergeData(array("title" => "Latest Updates", "description" => "The most recently added pages on this website"));
     array_unshift($this->_source, $default_feed);
     return parent::execute();
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:8,代码来源:List.php


示例15: _countArticles

 function _countArticles()
 {
     $articleset =& new ArticleSet(AMP_Registry::getDbcon());
     if (!($counts = $articleset->getGroupedIndex('class'))) {
         return false;
     }
     return $counts;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:8,代码来源:Links.inc.php


示例16: AMPSystem_Page

 function &instance($component_map = null)
 {
     static $global_page = false;
     if (!$global_page) {
         $global_page = new AMPSystem_Page(AMP_Registry::getDbcon(), $component_map);
     }
     return $global_page;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:8,代码来源:Page.inc.php


示例17: _initFormForWebAction

 function _initFormForWebAction(&$form, $action_id)
 {
     require_once 'Modules/WebAction/WebAction.php';
     $dbcon =& AMP_Registry::getDbcon();
     $publish_item =& new WebAction($dbcon, $_REQUEST['action']);
     $class_id = AMP_CONTENT_CLASS_ACTIONITEM;
     return $this->_initFormPublishItem($form, $publish_item, AMP_CONTENT_CLASS_ACTIONITEM);
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:8,代码来源:ComponentMap.inc.php


示例18: setUp

 function setUp()
 {
     $this->dbcon = AMP_Registry::getDbcon();
     $this->rs = $this->dbcon->Execute('select id from articles limit 1');
     $this->assertTrue($this->rs, $this->dbcon->ErrorMsg());
     $this->article = new Article($this->dbcon, $this->rs->fields[0]);
     $this->assertEqual(get_class($this->article), 'Article');
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:8,代码来源:TestArticleInc.php


示例19: _initThumbAttrs

 function _initThumbAttrs()
 {
     $reg =& AMP_Registry::instance();
     if ($thumb_attr = $reg->getEntry(AMP_REGISTRY_CONTENT_IMAGE_THUMB_ATTRIBUTES)) {
         $this->_thumb_attr = array_merge($this->_thumb_attr, $thumb_attr);
     } else {
         $this->_thumb_attr['width'] = AMP_IMAGE_WIDTH_THUMB;
     }
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:9,代码来源:List.inc.php


示例20: getDisplayIntro

 function getDisplayIntro()
 {
     if (!($intro = $this->getHeaderRef())) {
         $intro = new Article(AMP_Registry::getDbcon());
         $intro->setDefaults();
         $intro->mergeData(array('publish' => 1, 'title' => $this->getName() . $this->getListNameSuffix(), 'body' => $this->getBlurb(), 'class' => AMP_CONTENT_CLASS_SECTIONHEADER));
     }
     return $intro->getDisplay();
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:9,代码来源:Class.inc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP AMQPConnection类代码示例发布时间:2022-05-23
下一篇:
PHP AMPSystem_Lookup类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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