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


PHP close_popup_response函数代码示例

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


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

示例1: _valid_perform

  function _valid_perform(&$request, &$response)
  {
    $data = $this->dataspace->export();

    $request->set_status(REQUEST_STATUS_FAILURE);

    if($request->has_attribute('popup'))
      $response->write(close_popup_response($request));

    if(!isset($data['ids']) || !is_array($data['ids']))
      return;

    $objects = $this->_get_objects_to_delete(array_keys($data['ids']));

    foreach($objects as $id => $item)
    {
      if($item['delete_status'] !== 0 )
        continue;

      $site_object =& wrap_with_site_object($item);

      if(!$site_object->delete())
      {
        debug :: write_error("object couldn't be deleted",
         __FILE__ . ' : ' . __LINE__ . ' : ' .  __FUNCTION__,
        array('node_id' => $id));

        return;
      }
    }
    $request->set_status(REQUEST_STATUS_SUCCESS);

    $response->write(close_popup_response($request));
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:multi_delete_action.class.php

示例2: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     if (!($objects_amounts = $this->dataspace->get('amount'))) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $objects_data =& fetch_by_node_ids(array_keys($objects_amounts), $this->_define_catalog_object(), $counter);
     if (!$objects_data) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $object =& site_object_factory::create($this->_define_catalog_object());
     if (!method_exists($object, 'get_cart_item')) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $cart =& cart::instance();
     foreach ($objects_data as $key => $object_data) {
         $object->import_attributes($object_data);
         $cart_item =& $object->get_cart_item();
         $cart_item->set_amount($objects_amounts[$key]);
         $cart->add_item($cart_item);
     }
     $response->redirect('/root/cart?popup=1');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:add_cart_items_action.class.php

示例3: _valid_perform

  function _valid_perform(&$request, &$response)
  {
    $parent_object_data =& $this->_load_parent_object_data();

    $data['parent_node_id'] = $parent_object_data['node_id'];
    $data['controller_id'] = $this->_get_controller_id();

    $this->_valid_perform_prepare_data($data);

    $this->object->merge_attributes($data);

    if($this->_create_object_operation() === false)
    {
      $request->set_status(REQUEST_STATUS_FAILURE);
      return;
    }

    $this->indexer->add($this->object);

    $this->_write_create_access_policy();

    $request->set_status(REQUEST_STATUS_FORM_SUBMITTED);

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

示例4: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
     $data = $this->dataspace->export();
     if (!isset($data['ids']) || !is_array($data['ids'])) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         return;
     }
     $objects = $this->_get_objects(array_keys($data['ids']));
     foreach ($objects as $id => $item) {
         if (!isset($item['actions']['publish']) || !isset($item['actions']['unpublish'])) {
             continue;
         }
         $object = wrap_with_site_object($item);
         $status = $object->get_attribute('status');
         if ($status & SITE_OBJECT_PUBLISHED_STATUS) {
             $status &= ~SITE_OBJECT_PUBLISHED_STATUS;
             $action = 'unpublish';
         } else {
             $status |= SITE_OBJECT_PUBLISHED_STATUS;
             $action = 'publish';
         }
         $object->set_attribute('status', $status);
         $object->update(false);
         $this->_apply_access_policy($object, $action);
     }
     $request->set_status(REQUEST_STATUS_SUCCESS);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:30,代码来源:multi_toggle_publish_status_action.class.php

示例5: 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

示例6: _valid_perform

  function _valid_perform(&$request, &$response)
  {
    $locale_id = $this->dataspace->get('locale_id');
    $object_data = $this->_load_object_data();
    
    $site_object =& wrap_with_site_object($object_data);
    $site_object->set_locale_id($locale_id);
    $site_object->update(false);

    $request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
    if($request->has_attribute('popup'))
      $response->write(close_popup_response($request)); 
    
    if(!$this->dataspace->get('locale_recursive'))
      return;
    $params = array('depth' => -1,
                    'restrict_by_class' => false
                    );
    $objects = fetch_sub_branch($object_data['path'], 'site_object', $counter, $params);
    foreach ($objects as $object_id => $object_data)
    {
      $site_object =& wrap_with_site_object($object_data);
      $site_object->set_locale_id($locale_id);
      $site_object->update(false);
    }
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:change_locale_action.class.php

示例7: _valid_perform

  function _valid_perform(&$request, &$response)
  {
    if (!$this->dataspace->get('group_id'))
    {
      $request->set_status(REQUEST_STATUS_FAILURE);
      return;
    }

    $links_manager = new links_manager();

    $result = $links_manager->update_links_group(
        $this->dataspace->get('group_id'),
        $this->dataspace->get('identifier'),
        $this->dataspace->get('title')
    );

    if ($result !== false)
    {
      $request->set_status(REQUEST_STATUS_FORM_SUBMITTED);

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

示例8: 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

示例9: _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

示例10: perform

 function perform(&$request, &$response)
 {
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
     if (!($object = wrap_with_site_object(fetch_requested_object()))) {
         return;
     }
     $site_object_controller =& $object->get_controller();
     $action = $site_object_controller->determine_action($request);
     switch ($action) {
         case 'publish':
             $status = $this->get_publish_status($object);
             break;
         case 'unpublish':
             $status = $this->get_unpublish_status($object);
             break;
         default:
             return;
             break;
     }
     $object->set_attribute('status', $status);
     $object->update(false);
     $this->_apply_access_policy($object, $action);
     flush_fetcher_cache();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:set_publish_status_action.class.php

示例11: perform

 function perform(&$request, &$response)
 {
     $manager = new full_page_cache_manager();
     $manager->flush();
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:flush_full_page_cache_action.class.php

示例12: perform

  function perform(&$request, &$response)
  {
    $files = fs :: find(VAR_DIR . '/compiled', 'f');
    foreach($files as $file)
      unlink($file);

    if($request->has_attribute('popup'))
      $response->write(close_popup_response($request));

    $request->set_status(REQUEST_STATUS_SUCCESS);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:flush_template_cache_action.class.php

示例13: perform

 function perform(&$request, &$response)
 {
     $files = fs::find_subitems(CACHE_DIR, 'f');
     foreach ($files as $file) {
         unlink($file);
     }
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
     $request->set_status(REQUEST_STATUS_SUCCESS);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:flush_ini_cache_action.class.php

示例14: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     $data = $this->dataspace->export();
     $links_manager = new links_manager();
     if (isset($data['priority'])) {
         $links_manager->set_links_priority($data['priority']);
     }
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:set_links_priority_action.class.php

示例15: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     $data = $this->dataspace->export();
     $object =& site_object_factory::create('site_structure');
     if (isset($data['priority'])) {
         $object->save_priority($data['priority']);
     }
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:save_priority_action.class.php


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