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

PHP fetch_one_by_node_id函数代码示例

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

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



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

示例1: perform

	function perform()
	{
		$object_data = fetch_mapped_by_url();
		
		$parent_data = fetch_one_by_node_id($object_data['parent_node_id']);
		$path = $parent_data['path'];
		
		$params = complex_array :: array_merge($_GET, $_POST);

		$sep = '';
		$query = '';
		
		$flat_params = array();
		complex_array :: to_flat_array($params, $flat_params);
		
		foreach ($flat_params as $key => $value)
		{
			$query .= $sep . $key . '=' . urlencode($value);
			$sep = '&';
		} 
		if (!empty($query))
			$path .= '?' . $query;
		
		return new redirect_response(RESPONSE_STATUS_SUCCESS, $path);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:display_paragraph_action.class.php


示例2: render_image_select

 function render_image_select()
 {
     $id = $this->get_attribute('id');
     $md5id = substr(md5($id), 0, 5);
     $image_node_id = $this->get_value();
     $start_path = '';
     if ($image_node_id && ($image_data = fetch_one_by_node_id($image_node_id))) {
         $span_name = $image_data['identifier'];
         $start_path = '/root?action=image_select&node_id=' . $image_data['parent_node_id'];
     } else {
         $span_name = '';
     }
     if (!$start_path) {
         $start_path = $this->get_attribute('start_path');
         if (!$start_path) {
             $start_path = session::get('limb_image_select_working_path');
         }
         if (!$start_path) {
             $start_path = '/root/images';
         }
         $start_path .= '?action=image_select';
     }
     echo "<span id='{$md5id}_name'>{$span_name}</span><br><img id='{$md5id}_img' src='/shared/images/1x1.gif'/>\n      <script type='text/javascript'>\n        var image_select_{$md5id};\n\n        function init_image_select_{$md5id}()\n        {\n          image_select_{$md5id} = new image_select('{$id}', '{$md5id}');\n          image_select_{$md5id}.set_start_path('{$start_path}');\n          image_select_{$md5id}.generate();\n        }\n\n        function image_select_{$md5id}_insert_image(image)\n        {\n          image_select_{$md5id}.insert_image(image);\n        }\n\n        function image_select_{$md5id}_get_image()\n        {\n          return image_select_{$md5id}.get_image();\n        }\n\n        function image_reset_{$md5id}()\n        {\n          image_select_{$md5id}.id_container.value = 0;\n          init_image_select_{$md5id}();\n        }\n\n        add_event(window, 'load', init_image_select_{$md5id});\n      </script>";
     echo "<br><br><input class='button' type='button' onclick='popup(\"/root/tools/image_select?properties=0\", null, null, false, image_select_{$md5id}_insert_image, image_select_{$md5id}_get_image)' value='" . strings::get('select_image', 'image') . "'>";
     echo '&nbsp;';
     echo "<input class='button' type='button' onclick='image_reset_{$md5id}()' value='" . strings::get('reset') . "'>";
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:image_select_component.class.php


示例3: perform

	function perform(&$request, &$response)
	{
		if($request->has_attribute('popup'))
		  $response->write(close_popup_no_parent_reload_response());
	
	  $request->set_status(REQUEST_STATUS_FAILURE);
	  
		if(!$version = $request->get_attribute('version'))
			return;

		if(!$node_id = $request->get_attribute('version_node_id'))
	    return;
			
		if(!$site_object = wrap_with_site_object(fetch_one_by_node_id((int)$node_id)))
			return;
		
		if(!is_subclass_of($site_object, 'content_object'))
			return;

		if(!$site_object->recover_version((int)$version))
		  return;

		if($request->has_attribute('popup'))
		  $response->write(close_popup_response($request));
	
	  $request->set_status(REQUEST_STATUS_SUCCESS);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:recover_version_action.class.php


示例4: perform

 function perform()
 {
     $tree =& limb_tree::instance();
     if (isset($_REQUEST['id'])) {
         $node_id = (int) $_REQUEST['id'];
     } else {
         $node_id = get_mapped_id();
     }
     if (!isset($_REQUEST['direction'])) {
         return false;
     }
     if (!($object_data = fetch_one_by_node_id($node_id))) {
         debug::write_error('Node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('node_id' => $node_id));
         return false;
     }
     $direction = $_REQUEST['direction'];
     if (!($direction == 'up' || $direction == 'down')) {
         debug::write_error('Direction is not correct', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('direction' => $direction));
         return false;
     }
     if ($tree->change_node_order($node_id, $direction)) {
         reload(PHP_SELF . '#' . $node_id);
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:tree_change_order_action.class.php


示例5: render_file_select

 function render_file_select()
 {
     $id = $this->get_attribute('id');
     $md5id = substr(md5($id), 0, 5);
     $file_node_id = $this->get_value();
     if ($file_node_id && ($file_data = fetch_one_by_node_id($file_node_id))) {
         $span_name = $file_data['identifier'];
         $span_description = $file_data['description'];
         $span_size = $file_data['size'];
         $span_mime = $file_data['mime_type'];
         $start_path = '/root?action=file_select&node_id=' . $file_data['parent_node_id'];
     } else {
         $span_name = '';
         $span_description = '';
         $span_size = '';
         $span_mime = '';
     }
     $start_path_condition = "";
     if (!$start_path) {
         $start_path = $this->get_attribute('start_path');
         if (!$start_path) {
             $start_path = session::get('limb_file_select_working_path');
         }
         if (!$start_path) {
             $start_path = '/root/images_folder';
         }
         $start_path .= '?action=file_select';
     }
     $start_path_condition = "file_select_{$md5id}.set_start_path('{$start_path}');";
     echo "<span id='{$md5id}_span_empty'><img src='/shared/images/no_img.gif'></span>\n  \t\t\t\t<span id='{$md5id}_span_content'>\n  \t\t\t\t\t<a id='{$md5id}_href' href='#'><img id='{$md5id}_img' align='center' src='/shared/images/1x1.gif'/>&nbsp;<span id='{$md5id}_name'>{$span_name}</span></a><br>\n  \t\t\t\t\t<span id='{$md5id}_description'>{$span_description}</span><br>\n  \t\t\t\t\tsize:&nbsp;<span id='{$md5id}_size'>{$span_size}</span>&nbsp;bytes&nbsp;<br>\n  \t\t\t\t\tmime-type:<span id='{$md5id}_mime'>{$span_mime}</span>\n  \t\t\t\t</span><br><br>";
     echo "<script type='text/javascript'>\n\t\t    \tvar file_select_{$md5id};\n\t\t    \t\n\t\t      function init_file_select_{$md5id}()\n\t\t      {\n\t\t        file_select_{$md5id} = new file_select('{$id}', '{$md5id}');\n\t\t        {$start_path_condition}\n\t\t        file_select_{$md5id}.generate();\n\t\t      }\n\t\t      \n\t\t      function file_select_{$md5id}_insert_file(file)\n\t\t      {\n\t\t      \tfile_select_{$md5id}.insert_file(file);\n\t\t      }\n\t\n\t\t      function file_select_{$md5id}_get_file()\n\t\t      {\n\t\t      \treturn file_select_{$md5id}.get_file();\n\t\t      }\n\t\t      \n\t\t      function file_reset_{$md5id}()\n\t\t      {\n\t\t      \tfile_select_{$md5id}.id_container.value = 0;\n\t\t      \tinit_file_select_{$md5id}();\n\t\t      }\n\t\t     \n\t\t      add_event(window, 'load', init_file_select_{$md5id});\n\t\t    </script>";
     echo "<input class='button' type='button' onclick='popup(\"/root/file_select?\", null, null, false, file_select_{$md5id}_insert_file, file_select_{$md5id}_get_file)' value='" . strings::get('select_file', 'file') . "'>";
     echo '&nbsp;';
     echo "<input class='button' type='button' onclick='file_reset_{$md5id}()' value='" . strings::get('reset') . "'>";
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:35,代码来源:file_select_component.class.php


示例6: get_dataset

	function & get_dataset(&$counter, $params=array())
	{
		$counter = 0;
		
		if(!isset($_REQUEST['version']))
			return new empty_dataset();

		if(!isset($_REQUEST['version_node_id']))
			return new empty_dataset();
			
		$version = (int)$_REQUEST['version'];
		$node_id = (int)$_REQUEST['version_node_id'];

		if(!$site_object = wrap_with_site_object(fetch_one_by_node_id($node_id)))
			return new empty_dataset();
		
		if(!is_subclass_of($site_object, 'content_object'))
			return new empty_dataset();
		
		if(($version_data = $site_object->fetch_version($version)) === false)
			return new empty_dataset();
				
		$result = array();
		
		foreach($version_data as $attrib => $value)
		{
			$data['attribute'] = $attrib;
			$data['value'] = $value;
			$result[] = $data;
		}
		
		return new array_dataset($result);
	}		
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:33,代码来源:version_datasource.class.php


示例7: perform

 function perform(&$request, &$response)
 {
     $request->set_status(REQUEST_STATUS_FAILURE);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
     if (!($id = $request->get_attribute('id'))) {
         return;
     }
     if (!($object_data =& fetch_one_by_node_id((int) $id))) {
         return;
     }
     $object =& site_object_factory::create($object_data['class_name']);
     if (!method_exists($object, 'get_cart_item')) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         return;
     }
     $object->import_attributes($object_data);
     $cart_item =& $object->get_cart_item();
     $cart =& cart::instance();
     if ($quantity = (int) $request->get_attribute('quantity')) {
         $cart_item->set_amount($quantity);
     }
     $cart->add_item($cart_item);
     $request->set_status(REQUEST_STATUS_SUCCESS);
     $response->redirect('/root/cart?popup=1');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:add_cart_item_action.class.php


示例8: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     $tree =& tree::instance();
     $params = array();
     $params['identifier'] = $this->dataspace->get('identifier');
     $params['class'] = $this->dataspace->get('class_name');
     $params['title'] = $this->dataspace->get('title');
     $params['parent_node_id'] = $this->dataspace->get('parent_node_id');
     $params['controller_id'] = site_object_controller::get_id($this->dataspace->get('controller_name'));
     $object =& site_object_factory::create($params['class']);
     if (!($parent_data = fetch_one_by_node_id($params['parent_node_id']))) {
         error("parent wasn't retrieved", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
     }
     $object->merge_attributes($params);
     if (!$object->create()) {
         error("object wasn't registered", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
     }
     $parent_object =& site_object_factory::create($parent_data['class_name']);
     $parent_object->merge_attributes($parent_data);
     $access_policy =& access_policy::instance();
     $access_policy->save_initial_object_access($object, $parent_object);
     $request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:register_new_object_action.class.php


示例9: perform

 function perform()
 {
     $tree =& limb_tree::instance();
     if (isset($_REQUEST['id'])) {
         $node_id = (int) $_REQUEST['id'];
     } else {
         $node_id = get_mapped_id();
     }
     if (!isset($_REQUEST['direction'])) {
         return new failed_response();
     }
     if (!($object_data = fetch_one_by_node_id($node_id))) {
         debug::write_error('Node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('node_id' => $node_id));
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
     $direction = $_REQUEST['direction'];
     if (!($direction == 'up' || $direction == 'down')) {
         debug::write_error('Direction is not correct', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('direction' => $direction));
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
     if ($tree->change_node_order($node_id, $direction)) {
         return new close_popup_response();
     } else {
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:tree_change_order_action.class.php


示例10: array

 function &get_dataset(&$counter, $params = array())
 {
     $counter = 0;
     $request = request::instance();
     if (!($version = $request->get_attribute('version'))) {
         return new empty_dataset();
     }
     if (!($node_id = $request->get_attribute('version_node_id'))) {
         return new empty_dataset();
     }
     $version = (int) $version;
     $node_id = (int) $node_id;
     if (!($site_object = wrap_with_site_object(fetch_one_by_node_id($node_id)))) {
         return new empty_dataset();
     }
     if (!is_subclass_of($site_object, 'content_object')) {
         return new empty_dataset();
     }
     if (($version_data = $site_object->fetch_version($version)) === false) {
         return new empty_dataset();
     }
     $result = array();
     foreach ($version_data as $attrib => $value) {
         $data['attribute'] = $attrib;
         $data['value'] = $value;
         $result[] = $data;
     }
     return new array_dataset($result);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:29,代码来源:version_datasource.class.php


示例11: _get_template_path_from_node

 function _get_template_path_from_node($node_id)
 {
     if (!($site_object =& wrap_with_site_object(fetch_one_by_node_id($node_id)))) {
         return null;
     }
     $controller =& $site_object->get_controller();
     return $controller->get_action_property($controller->get_default_action(), 'template_path');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:display_template_source_action.class.php


示例12: _init_parent_node_id

 function _init_parent_node_id()
 {
     if (!($ids = $this->dataspace->get('ids'))) {
         return;
     }
     $id = key($ids);
     //we need only one
     $object = fetch_one_by_node_id($id);
     $this->dataspace->set('parent_node_id', $object['parent_node_id']);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:multi_move_action.class.php


示例13: render_image_select

	function render_image_select()
	{ 
		$id = $this->get_attribute('id');	
  	$md5id = substr(md5($id), 0, 5);

  	$image_node_id = $this->get_value();
  	
  	if($image_node_id && $image_data = fetch_one_by_node_id($image_node_id))
  	{
			$span_name = $image_data['identifier'];
//			$span_description = $image_data['description'];
//			$span_size = $image_data['size'];
//			$span_mime = $image_data['mime_type'];
		}
		else
		{
			$span_name = '';
//			$span_description = '';
//			$span_size = '';
//			$span_mime = '';
		}
  	  	
  	echo "<span id='{$md5id}_name'>{$span_name}</span><br><img id='{$md5id}_img' src='/shared/images/1x1.gif'/>
	    <script type='text/javascript'>
	    	var image_select_{$md5id};
	    	
	      function init_image_select_{$md5id}()
	      {
	        image_select_{$md5id} = new image_select('{$id}', '{$md5id}');
	        image_select_{$md5id}.generate();
	      }
	      
	      function image_select_{$md5id}_insert_image(image)
	      {
	      	image_select_{$md5id}.insert_image(image);
	      }

	      function image_select_{$md5id}_get_image()
	      {
	      	return image_select_{$md5id}.get_image();
	      }
	      
	      function image_reset_{$md5id}()
	      {
	      	image_select_{$md5id}.id_container.value = 0;
	      	init_image_select_{$md5id}();
	      }
	     
	      add_event(window, 'load', init_image_select_{$md5id});
	    </script>";
	    
	  echo "<br><br><input class='button' type='button' onclick='popup(\"/root/image_select?properties=0\", null, null, false, image_select_{$md5id}_insert_image, image_select_{$md5id}_get_image)' value='Select image'>";
	  echo '&nbsp;';
	  echo "<input class='button' type='button' onclick='image_reset_{$md5id}()' value='Reset'>";
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:55,代码来源:image_select_component.class.php


示例14: _valid_perform

 function _valid_perform()
 {
     $object_data =& fetch_mapped_by_url();
     $object =& site_object_factory::create($this->definition['site_object']);
     $object->import_attributes($object_data);
     if (!$object->delete()) {
         return false;
     }
     $parent_object_data = fetch_one_by_node_id($object_data['parent_id']);
     close_popup(null, true);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:form_delete_site_object_action.class.php


示例15: _can_parent_accept_node

 function _can_parent_accept_node($parent_node_id, $node_id)
 {
     if (!($parent_object = wrap_with_site_object(fetch_one_by_node_id($parent_node_id)))) {
         debug::write_error('acceptor node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('parent_node_id' => $parent_node_id));
         return false;
     }
     if (!($target_data = fetch_one_by_node_id($node_id))) {
         debug::write_error('node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('node_id' => $node_id));
         return false;
     }
     return $parent_object->can_accept_child_class($target_data['class_name']);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:tree_move_item_action.class.php


示例16: _valid_perform

 function _valid_perform()
 {
     $object_data =& fetch_mapped_by_url();
     $object =& site_object_factory::create($this->definition['site_object']);
     $object->import_attributes($object_data);
     if (!$object->delete()) {
         message_box::write_notice('Can not be deleted!');
         return new failed_response();
     }
     $parent_object_data = fetch_one_by_node_id($object_data['parent_node_id']);
     return new close_popup_response(RESPONSE_STATUS_FORM_SUBMITTED, RELOAD_SELF_URL, true);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:form_delete_site_object_action.class.php


示例17: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     $node_id = $this->dataspace->get('id');
     if (!($object = wrap_with_site_object(fetch_one_by_node_id($node_id)))) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         return;
     }
     $object->set_attribute('controller_id', site_object_controller::get_id($this->dataspace->get('controller_name')));
     $object->update(false);
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:14,代码来源:change_controller_action.class.php


示例18: render_image_select

 function render_image_select()
 {
     $id = $this->get_attribute('id');
     $md5id = substr(md5($id), 0, 5);
     $image_node_id = $this->get_value();
     if ($image_node_id && ($image_data = fetch_one_by_node_id($image_node_id))) {
         $span_name = $image_data['identifier'];
     } else {
         $span_name = '';
     }
     echo "<span id='{$md5id}_name'>{$span_name}</span><br><img id='{$md5id}_img' src='/shared/images/1x1.gif'/>\n\t    <script type='text/javascript'>\n\t    \tvar image_select_{$md5id};\n\t    \t\n\t      function init_image_select_{$md5id}()\n\t      {\n\t        image_select_{$md5id} = new image_select('{$id}', '{$md5id}');\n\t        image_select_{$md5id}.generate();\n\t      }\n\t      \n\t      function image_select_{$md5id}_insert_image(image)\n\t      {\n\t      \timage_select_{$md5id}.insert_image(image);\n\t      }\n\n\t      function image_select_{$md5id}_get_image()\n\t      {\n\t      \treturn image_select_{$md5id}.get_image();\n\t      }\n\t      \n\t      function image_reset_{$md5id}()\n\t      {\n\t      \timage_select_{$md5id}.id_container.value = 0;\n\t      \tinit_image_select_{$md5id}();\n\t      }\n\t     \n\t      add_event(window, 'load', init_image_select_{$md5id});\n\t    </script>";
     echo "<br><br><input class='button' type='button' onclick='popup(\"/root/image_select?properties=0\", null, null, false, image_select_{$md5id}_insert_image, image_select_{$md5id}_get_image)' value='" . strings::get('select_image', 'image') . "'>";
     echo '&nbsp;';
     echo "<input class='button' type='button' onclick='image_reset_{$md5id}()' value='" . strings::get('reset') . "'>";
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:15,代码来源:image_select_component.class.php


示例19: perform

 function perform()
 {
     if (!isset($_REQUEST['path'])) {
         return new response(RESPONSE_STATUS_DONT_TRACK);
     }
     if (!($node = map_url_to_node($_REQUEST['path']))) {
         return new response(RESPONSE_STATUS_DONT_TRACK);
     }
     if (!($object = fetch_one_by_node_id($node['id']))) {
         return new response(RESPONSE_STATUS_DONT_TRACK);
     }
     $dataspace =& $this->view->find_child('parent_node_data');
     $dataspace->import($object);
     return new response(RESPONSE_STATUS_DONT_TRACK);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:15,代码来源:node_select_action.class.php


示例20: perform

 function perform(&$request, &$response)
 {
     $request->set_status(REQUEST_STATUS_DONT_TRACK);
     if (!($path = $request->get_attribute('path'))) {
         return;
     }
     if (!($node = map_url_to_node($path))) {
         return;
     }
     if (!($object = fetch_one_by_node_id($node['id']))) {
         return;
     }
     session::set('limb_node_select_working_path', $path);
     $dataspace =& $this->view->find_child('parent_node_data');
     $dataspace->import($object);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:16,代码来源:node_select_action.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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