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

PHP id_of函数代码示例

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

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



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

示例1: run_job

 function run_job()
 {
     reason_include_once('minisite_templates/nav_classes/default.php');
     $page_ids = $this->config('page_ids');
     $id = reset($page_ids);
     $page = new entity($id);
     $site = $page->get_owner();
     // lets make and get the page tree
     $page_tree = new MinisiteNavigation();
     $page_tree->order_by = 'sortable.sort_order';
     $page_tree->init($site->id(), id_of('minisite_page'));
     foreach ($page_ids as $page_id) {
         $children = $page_tree->children($page_id);
         $diff = array_diff($children, $page_ids);
         // are we trying to move a page without its children?
         if (!empty($diff)) {
             $problem[] = 'Cannot move page id ' . $page_id . ' without also moving child pages with ids (' . implode(", ", $diff) . ')';
         }
     }
     if (isset($problem)) {
         $report = 'Blocking any further jobs. When moving pages you need to move entire branches';
         $report .= '<ul>';
         $report .= '<li>' . implode("</li><li>", $problem) . '</li>';
         $report .= '</ul>';
         $this->set_report($report);
         $this->block_jobs();
         return false;
     } else {
         $this->set_report('Verified that the page tree integrity is preserved with this move.');
     }
     return true;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:32,代码来源:move_entities_among_sites_helper.php


示例2: show_feed_link

 function show_feed_link()
 {
     $type = new entity(id_of('event_type'));
     if ($type->get_value('feed_url_string')) {
         echo '<div class="feedInfo"><a href="/' . REASON_GLOBAL_FEEDS_PATH . '/' . $type->get_value('feed_url_string') . '" title="RSS feed for this site\'s events">xml</a></div>';
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:events_instancewide.php


示例3: _produce_borrowing_nav

 function _produce_borrowing_nav()
 {
     $ret = '';
     $nes = new entity_selector();
     $nes->add_type(id_of('type'));
     $nes->add_right_relationship($this->admin_page->site_id, relationship_id_of('site_cannot_edit_type'));
     $nes->add_relation('`entity`.`id` = "' . addslashes($this->admin_page->type_id) . '"');
     $nes->set_num(1);
     $nes->limit_tables();
     $nes->limit_fields();
     $ns = $nes->run_one();
     $show_edit = reason_user_has_privs($this->admin_page->user_id, 'edit') && !$this->admin_page->is_second_level() && empty($ns) ? true : false;
     /* $type = new entity($this->admin_page->type_id);
     			$name = $type->get_value('plural_name') ? $type->get_value('plural_name') : $type->get_value('name');
     			if(function_exists('mb_strtolower'))
     				$name = mb_strtolower($name);
     			else
     				$name = strtolower($name); */
     $ret .= '<div class="borrowNav">' . "\n";
     $ret .= '<ul>';
     if ($show_edit) {
         $ret .= '<li><a href="' . $this->admin_page->get_owned_list_link($this->admin_page->type_id) . '"><img src="' . REASON_HTTP_BASE_PATH . 'silk_icons/bullet_edit.png" alt="" /> Add &amp; edit</a></li>';
     }
     $ret .= '<li class="current"><strong><img src="' . REASON_HTTP_BASE_PATH . 'silk_icons/car.png" alt="" /> Borrow</strong></li>';
     $ret .= '</ul>' . "\n";
     $ret .= '</div>' . "\n";
     // if(reason_user_has_privs($this->admin_page->user_id,'edit'))
     return $ret;
 }
开发者ID:natepixel,项目名称:reason_package,代码行数:29,代码来源:sharing.php


示例4: get_site_type_entity

 protected function get_site_type_entity()
 {
     if (!isset($this->site_type_entity)) {
         $this->site_type_entity = new entity(id_of('site'));
     }
     return $this->site_type_entity;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_site_deleter.php


示例5: get_pages_needing_change

 function get_pages_needing_change()
 {
     if (!isset($this->pages_needing_change)) {
         $es = new entity_selector();
         $es->add_type(id_of('minisite_page'));
         $es->enable_multivalue_results();
         $es->limit_tables('page_node');
         $es->limit_fields('custom_page');
         $es->add_relation('page_node.custom_page = "blurb"');
         $es->add_left_relationship_field('minisite_page_to_text_blurb', 'entity', 'id', 'blurb_id');
         $result = $es->run_one();
         foreach ($result as $k => $page) {
             $blurbs = is_array($page->get_value('blurb_id')) ? $page->get_value('blurb_id') : array($page->get_value('blurb_id'));
             foreach ($blurbs as $blurb_id) {
                 $blurb = new entity($blurb_id);
                 $content = $blurb->get_value('content');
                 $demoted_content = demote_headings($content, 1);
                 if ($content == $demoted_content) {
                     $pages_needing_page_type_change[$k] = $k;
                 }
             }
         }
         $this->pages_needing_change = isset($pages_needing_page_type_change) ? array_keys($pages_needing_page_type_change) : false;
     }
     return $this->pages_needing_change;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:26,代码来源:blurb_page_type_change.php


示例6: get_links

 function get_links()
 {
     $links = parent::get_links();
     $es = new entity_selector($this->admin_page->site_id);
     $es->add_type(id_of('event_type'));
     $es->set_order('dated.datetime DESC');
     $values = $es->run_one();
     //should adjust so that can't rearrange slots for events that have only one or no registration slots.
     //also, probably not for past events either.
     if ($values) {
         foreach ($values as $event_id => $event) {
             $es2 = new entity_selector($this->admin_page->site_id);
             $es2->add_type(id_of('registration_slot_type'));
             $es2->add_right_relationship($event_id, relationship_id_of('event_type_to_registration_slot_type'));
             $numSlots = $es2->get_one_count();
             if ($numSlots > 1) {
                 $date = $event->get_value('datetime');
                 $name = 'Sort slots for ' . $event->get_value('name') . ' - ' . prettify_mysql_datetime($date);
                 $link = $this->admin_page->make_link(array('event_id' => $event->id(), 'default_sort' => false), true);
                 $links[$name] = $link;
             }
         }
         $this->links = $links;
         return $this->links;
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:26,代码来源:registration_slot.php


示例7: get_feature_type_entity

 protected function get_feature_type_entity()
 {
     if (!isset($this->feature_type_entity)) {
         $this->feature_type_entity = new entity(id_of('feature_type'));
     }
     return $this->feature_type_entity;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_feature_display_name_handler.php


示例8: alter_es

		function alter_es() // {{{
		{
			if (!$this->params['limit_to_current_site'])
			{
				$alias = $this->es->add_right_relationship_field('owns', 'entity', 'name', 'site_name');
				$site_order_string = $alias['site_name']['table'] . '.' . $alias['site_name']['field'] . ' ASC';
				$this->es->set_order( $site_order_string . ', entity.last_modified DESC' );
			}
			else
			{
				$this->es->set_order( 'entity.last_modified DESC' );
			}
			if(!empty($this->params['audiences']))
			{
				$aud_ids = array();
				foreach($this->params['audiences'] as $audience)
				{
					$aud_id = id_of($audience);
					if($aud_id)
					{
						$aud_ids[] = $aud_id;
					}
					else
					{
						trigger_error($audience.' is not a unique name; skipping this audience');
					}
				}
				if(!empty($aud_ids))
				{
					$this->es->add_left_relationship($aud_ids, relationship_id_of('faq_to_audience'));
				}
			}
		} // }}}
开发者ID:natepixel,项目名称:reason_package,代码行数:33,代码来源:faqs.php


示例9: user_has_access_to_media

 /**
  * Determines whether or not the current user has access to the specified media work.  If no username is provided, this function defaults to the currently-loggin-in username.
  *
  * @param string $username
  * @return boolean user has access
  */
 public function user_has_access_to_media($username = '')
 {
     // First, get the restricted group--if one exists
     $es = new entity_selector();
     $es->add_type(id_of('group_type'));
     $es->add_right_relationship($this->media_work->id(), relationship_id_of('av_restricted_to_group'));
     $group = current($es->run_one());
     if (!empty($group)) {
         $gh = new group_helper();
         $gh->set_group_by_id($group->id());
         if ($gh->requires_login()) {
             if (!$username) {
                 $username = reason_check_authentication();
             }
             if ($username) {
                 if (!$gh->is_username_member_of_group($username)) {
                     return false;
                 }
             } else {
                 return false;
             }
         }
     }
     return true;
     // Return true if the user has access to view media work
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:32,代码来源:media_work_helper.php


示例10: init

 function init($args = array())
 {
     parent::init($args);
     /*
     			$es = new entity_selector( $this->parent->site_id );
     			$es->add_type( id_of( 'policy_type' ) );
     			//$es->set_order( 'sortable.sort_order ASC' );
     			$es->set_order( 'entity.name ASC' );
     			$es->add_left_relationship_field( 'parent' , 'entity' , 'id' , 'parent_id' );
     			$es->add_right_relationship( $this->parent->cur_page->id(), relationship_id_of('page_to_policy') );
     
     			$this->values = $es->run_one();
     */
     //$this->pages->order_by = 'sortable.sort_order ASC';
     //Set up our AllPolicyNavigation to grab all the policies associated
     //with a given page and sort them by sort_order.
     //I am not really sure how necessary it is to use a mutiple_root_tree_viewer,
     //but it works.
     $this->pages = new AllPolicyNavigation();
     $this->pages->init($this->parent->site_id, id_of('policy_type'));
     $this->pages->es->set_order('sortable.sort_order ASC');
     $this->pages->es->add_left_relationship_field('policy_parent', 'entity', 'id', 'parent_id');
     $this->pages->es->add_right_relationship($this->parent->cur_page->id(), relationship_id_of('page_to_policy'));
     $this->pages->values = $this->pages->es->run_one();
     //$this->pages->request =& $this->request;
     //I don't think this kludge is required for this usage, so I am commenting it out
     //Just in case, though, I am leaving it in the code. JLO 03/10/04
     // small kludge - just give the tree view access to the site info.  used in the show_item function to show the root node of the navigation
     //if ( !empty ( $this->site_info ) )
     //	$this->pages->site_info = $this->site_info;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:31,代码来源:policy_related_all.php


示例11: run

 /**
  * Run the upgrader
  * @return string HTML report
  */
 public function run()
 {
     $run_message = '';
     if (!reason_relationship_name_exists('news_to_media_work')) {
         $news_to_media_work_definition = array('description' => 'News / Post shows Media Work', 'directionality' => 'bidirectional', 'connections' => 'many_to_many', 'required' => 'no', 'is_sortable' => 'yes', 'display_name' => 'Media', 'display_name_reverse_direction' => 'News / Posts');
         if (create_allowable_relationship(id_of('news'), id_of('av'), 'news_to_media_work', $news_to_media_work_definition)) {
             $run_message .= '<p>Added the news_to_media_work allowable relationship.</p>';
         } else {
             $run_message .= '<p>Failed to create the news_to_media_work allowable relationship. Try again. If you are not successful, you may wish to try to add this relationship type manually: In Master Admin, go to Allowable Relationship Manager, add a row, then create a relationship between News / Post and Media Work named news_to_media work. The other values are:</p>' . spray($news_to_media_work_definition);
         }
     }
     if (!reason_relationship_name_exists('event_to_media_work')) {
         $event_to_media_work_definition = array('description' => 'Event shows Media Work', 'directionality' => 'bidirectional', 'connections' => 'many_to_many', 'required' => 'no', 'is_sortable' => 'yes', 'display_name' => 'Media', 'display_name_reverse_direction' => 'Events');
         if (create_allowable_relationship(id_of('event_type'), id_of('av'), 'event_to_media_work', $event_to_media_work_definition)) {
             $run_message .= '<p>Added the event_to_media_work allowable relationship.</p>';
         } else {
             $run_message .= '<p>Failed to create the event_to_media_work allowable relationship. Try again. If you are not successful, you may wish to try to add this relationship type manually: In Master Admin, go to Allowable Relationship Manager, add a row, then create a relationship between Event and Media Work named event_to_media work. The other values are:</p>' . spray($event_to_media_work_definition);
         }
     }
     if (!empty($run_message)) {
         return $run_message;
     } else {
         return 'This update has already run.';
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:29,代码来源:add_media_work_relationships.php


示例12: build

 /**
  * Make sure that the model is configured with a valid URL.
  *
  * @return string json
  */
 function build()
 {
     if ($site_id = $this->config('site_id')) {
         $s = get_microtime();
         $es = new entity_selector();
         $es->add_type(id_of('social_account_type'));
         $es->add_right_relationship($site_id, relationship_id_of('site_to_social_account'));
         $es->add_rel_sort_field($site_id, relationship_id_of('site_to_social_account'));
         $es->set_order('rel_sort_order ASC');
         $es->limit_tables();
         $es->limit_fields();
         if ($results = $es->run_one()) {
             $result_keys = array_keys($results);
             $sih = reason_get_social_integration_helper();
             foreach ($result_keys as $id) {
                 // get the integrator if it supports the SocialAccountProfileLinks interface
                 if ($integrator = $sih->get_social_account_integrator($id, 'SocialAccountProfileLinks')) {
                     $profile_links[$id]['icon'] = $integrator->get_profile_link_icon($id);
                     $profile_links[$id]['text'] = $integrator->get_profile_link_text($id);
                     $profile_links[$id]['href'] = $integrator->get_profile_link_href($id);
                 }
             }
             if (!empty($profile_links)) {
                 return $profile_links;
             }
         }
         return false;
     } else {
         trigger_error('The ReasonSocialProfileLinksModel must be provided with the configuration parameter site_id.', FATAL);
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:36,代码来源:profile_links.php


示例13: process

 function process()
 {
     //prep site
     $this->helper->ensure_type_is_on_site(id_of('publication_type'));
     $this->helper->ensure_type_is_on_site(id_of('group_type'));
     $this->helper->ensure_nobody_group_is_on_site();
     // gather core information
     $pub_type_id = id_of('publication_type');
     $name = trim(strip_tags($this->get_value('pub_name')));
     // populate values array
     $values['new'] = 0;
     $values['description'] = trim(get_safer_html($this->get_value('pub_description')));
     $values['unique_name'] = trim(strip_tags($this->get_value('pub_unique_name')));
     $values['state'] = 'Live';
     $values['hold_comments_for_review'] = 'no';
     $values['posts_per_page'] = turn_into_int($this->get_value('pub_posts_per_page'));
     $values['blog_feed_string'] = trim(strip_tags($this->get_value('pub_rss_feed_url')));
     $values['publication_type'] = 'Newsletter';
     $values['has_issues'] = 'no';
     $values['has_sections'] = 'no';
     $values['date_format'] = $this->get_value('date_format');
     // create the publication
     $pub_id = reason_create_entity($this->site_id, $pub_type_id, $this->user_id, $name, $values);
     // associate with nobody posting and commenting groups
     create_relationship($pub_id, id_of('nobody_group'), relationship_id_of('publication_to_authorized_posting_group'));
     create_relationship($pub_id, id_of('nobody_group'), relationship_id_of('publication_to_authorized_commenting_group'));
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:27,代码来源:migrator_screen_3.php


示例14: get_social_account_type_entity

 protected function get_social_account_type_entity()
 {
     if (!isset($this->social_account_type_entity)) {
         $this->social_account_type_entity = new entity(id_of('social_account_type'));
     }
     return $this->social_account_type_entity;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_social_account_display_name_handler.php


示例15: thor_build_display_values

	function thor_build_display_values()
	{
		$form = new entity($this->form_id);
		$form->get_values();
		if ($form->get_value('type') != id_of('form'))
		{
			trigger_error('the thor viewer was passed an invalid id ('.$form_id.') - it must be passed the ID of a reason form entity');
		}
		else
		{
			$form_xml_obj = new XMLParser($form->get_value('thor_content'));
			$form_xml_obj->Parse();
			$display_values = array();
			foreach ($form_xml_obj->document->tagChildren as $k=>$v)
			{
				$tagname = is_object($v) ? $v->tagName : '';
				if (method_exists($this, '_build_display_'.$tagname))
				{
					$build_function = '_build_display_'.$tagname;
					$display_values = array_merge($display_values, $this->$build_function($v));
				}
			}
		}
		foreach ($this->extra_fields as $field_name)
		{
			$display_values[$field_name]['label'] = prettify_string($field_name);
			$display_values[$field_name]['type'] = 'text';
		}
		$this->_display_values = (isset($display_values)) ? $display_values : array();
	}
开发者ID:natepixel,项目名称:reason_package,代码行数:30,代码来源:thor_viewer.php


示例16: _get_events

		function _get_events()
		{
			if(!isset($this->events))
			{
				$es = new entity_selector($this->site_id);
				$es->add_type(id_of('event_type'));
				
				if(!in_array('archived',$this->params['show']))
				{
					$es->add_relation('`last_occurence` >= "'.addslashes(date('Y-m-d')).'"');
				}
				if(!in_array('upcoming',$this->params['show']))
				{
					$es->add_relation('`datetime` < "'.addslashes(date('Y-m-d',time() + (60*60*24))).'"');
				}
				if(!in_array('current',$this->params['show']))
				{
					$es->add_relation('(`last_occurence` < "'.addslashes(date('Y-m-d')).'" OR `datetime` >= "'.addslashes(date('Y-m-d',time() + (60*60*24))).'")');
				}
				$es->add_relation('`show_hide` = "show"');
				$es->set_order($this->params['order']);
				$this->_modify_events_es($es);
				$events = $es->run_one();
				$class = $this->get_model_class($this->params['model']);
				foreach($events as $id => $event)
				{
					$this->events[$id] = new $class($event);
				}
				if(empty($this->events))
					$this->events = array();
			}
			return $this->events;
		}
开发者ID:natepixel,项目名称:reason_package,代码行数:33,代码来源:module.php


示例17: get_field_type_entity

 protected function get_field_type_entity()
 {
     if (!isset($this->field_type_entity)) {
         $this->field_type_entity = new entity(id_of('field'));
     }
     return $this->field_type_entity;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_field_display_name_handler.php


示例18: init

 /**
  * Standard Module init function
  * 
  * @return void
  */
 function init()
 {
     if (!empty($this->admin_page->id)) {
         $this->_event = new entity($this->admin_page->id);
     } else {
         $this->_should_run = false;
         $this->_no_run_msg = 'No event ID provided.';
         return;
     }
     if (!reason_user_has_privs($this->admin_page->user_id, 'add') || !reason_user_has_privs($this->admin_page->user_id, 'edit')) {
         $this->_should_run = false;
         $this->_no_run_msg = 'You do not have the privileges to duplicate an event.';
         return;
     }
     if (empty($this->_event) || !$this->_event->get_values() || $this->_event->get_value('type') != id_of('event_type')) {
         $this->_should_run = false;
         $this->_no_run_msg = 'The item you are trying to split up is not an event.';
         return;
     }
     $owner = $this->_event->get_owner();
     if ($owner->id() != $this->admin_page->site_id) {
         $this->_should_run = false;
         $this->_no_run_msg = 'The event you are trying to split up is not owned by the current site.';
         return;
     }
     $dates = $dates = $this->_get_dates_from_event($this->_event);
     if (count($dates) < 2) {
         $this->_should_run = false;
         $this->_no_run_msg = 'The event you are trying to split up only occurs on one date.';
         return;
     }
     $this->admin_page->title = 'Split Up Event: "' . $this->_event->get_value('name') . '"';
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:38,代码来源:event_split.php


示例19: create_type

function create_type($site, $type, $user, $name, $array)
{
    $ret = reason_create_entity($site, $type, $user, $name, $array);
    id_of('type', false);
    //clear cache
    create_default_rels_for_new_type($ret, $array['unique_name']);
    return $ret;
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:8,代码来源:classified.php


示例20: alter_data

 function alter_data()
 {
     $this->set_display_name('name', 'Section Name');
     $this->remove_element('keywords');
     $this->add_relationship_element('publication', id_of('publication_type'), relationship_id_of('news_section_to_publication'), 'right', 'select');
     //$this->add_required('publication');
     $this->set_order(array('publication', 'name'));
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:8,代码来源:news_section.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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