当前位置: 首页>>代码示例>>PHP>>正文


PHP Position::create_position方法代码示例

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


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

示例1: livecdcreateAction

 function livecdcreateAction()
 {
     if (!defined("NOTIF_OFF")) {
         //Lets keep liveCD screens private for now
         define("NOTIF_OFF", 1);
     }
     $this->setTitle('Screen Creation');
     $screen = new Screen();
     //Defaults for live cds
     /*
     $default_template = 22;
     $default_subscriptions[73][] = 0;
     $default_subscriptions[74][] = 1;
     $default_subscriptions[74][] = 30;
     $default_subscriptions[75][] = 8;
     $default_subscriptions[75][] = 11;
     */
     if (!isset($default_template) || !isset($default_subscriptions) || !is_array($default_subscriptions)) {
         $this->flash('Live CD support has not been configured yet.  Please contact an administrator.', 'error');
         redirect_to(ADMIN_URL);
     }
     if ($screen->create_screen($_POST[screen][name], $_POST[screen][group], $_POST[screen][location], $_POST[screen][mac_inhex], $_POST[screen][width], $_POST[screen][height], $default_template, 1)) {
         //Now setup some sample subscriptions
         foreach ($default_subscriptions as $field_id => $subscriptions) {
             foreach ($subscriptions as $feed_id) {
                 $pos = new Position();
                 $pos->create_position($screen->id, $feed_id, $field_id);
             }
         }
         redirect_to(ROOT_URL . '/?mac=' . $_POST[screen][mac_inhex] . '&w=' . $_POST[screen][width] . '&h=' . $_POST[screen][height] . '&livecd=1');
     } else {
         $this->flash('The screen creation failed. ' . 'Please check all fields and try again; contact an administrator if all else fails.', 'error');
         redirect_to(ADMIN_URL . '/screens/livecd?mac=' . $_POST[screen][mac_inhex] . '&w=' . $_POST[screen][width] . '&h=' . $_POST[screen][height] . '&livecd=1');
     }
 }
开发者ID:TNValleyFiddlersConvention,项目名称:fiddlers,代码行数:35,代码来源:controller.php

示例2: Position

	function add_feed($feed_id_in){
		if($this->screen_set){
         if(is_array($this->screen_pos))
			foreach($this->screen_pos as $pos){
				if($pos->feed_id == $feed_id_in){
					return true; //The mapping already exists.  Someone cannot see that, maybe they are using an iphone and the screen is tiny. dumb iphone
				}
			}
			$new_pos = new Position();
			if($new_pos->create_position($this->screen_id, $feed_id_in, $this->id)){
				$this->screen_pos[] = $new_pos;
				$notify = new Notification();
				$notify->notify('screen', $this->screen_id, 'feed', $feed_id_in, 'subscribe');	
                                return true;
			} else {
				return false;
			}
		} else {
			return false; //No screen = no fun :-(
		}
	}
开发者ID:TNValleyFiddlersConvention,项目名称:fiddlers,代码行数:21,代码来源:field.php


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