當前位置: 首頁>>代碼示例>>PHP>>正文


PHP panels_edit_cache_clear函數代碼示例

本文整理匯總了PHP中panels_edit_cache_clear函數的典型用法代碼示例。如果您正苦於以下問題:PHP panels_edit_cache_clear函數的具體用法?PHP panels_edit_cache_clear怎麽用?PHP panels_edit_cache_clear使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了panels_edit_cache_clear函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: page_content

 function page_content($js, $input, $entity, $view_mode)
 {
     $panelizer = $entity->panelizer[$view_mode];
     if (empty($panelizer)) {
         return MENU_NOT_FOUND;
     }
     list($entity_id, $revision_id, $bundle) = entity_extract_ids($this->entity_type, $entity);
     $form_state = array('entity' => $entity, 'revision info' => $this->entity_allows_revisions($entity), 'display cache' => panels_edit_cache_get(implode(':', array_filter(array('panelizer', $this->entity_type, $entity_id, $view_mode, $revision_id)))), 'no_redirect' => TRUE);
     ctools_include('common', 'panelizer');
     $output = drupal_build_form('panelizer_edit_content_form', $form_state);
     if (!empty($form_state['executed'])) {
         if (!empty($form_state['clicked_button']['#save-display'])) {
             drupal_set_message(t('The settings have been updated.'));
             $entity->panelizer[$view_mode]->display = $form_state['display'];
             $entity->panelizer[$view_mode]->display_is_modified = TRUE;
             $this->entity_save($entity);
         } else {
             drupal_set_message(t('Changes have been discarded.'));
         }
         panels_edit_cache_clear($form_state['display cache']);
         drupal_goto($_GET['q']);
     }
     $output = $this->wrap_entity_panelizer_pages($entity, $view_mode, $output);
     ctools_set_no_blocks(FALSE);
     drupal_set_page_content($output);
     $page = element_info('page');
     return $page;
 }
開發者ID:Probo-Demos,項目名稱:drupal_github,代碼行數:28,代碼來源:PanelizerEntityDefault.class.php

示例2: ajax_save_form

 /**
  * AJAX entry point to create the controller form for an IPE.
  */
 function ajax_save_form($break = NULL)
 {
     if ($this->ipe_test_lock('save-form', $break)) {
         return;
     }
     // Reset the $_POST['ajax_html_ids'] values to preserve
     // proper IDs on form elements when they are rebuilt
     // by the Panels IPE without refreshing the page
     $_POST['ajax_html_ids'] = array();
     $form_state = array('display' => &$this->display, 'content_types' => $this->cache->content_types, 'rerender' => FALSE, 'no_redirect' => TRUE, 'layout' => $this->plugins['layout']);
     $output = drupal_build_form('panels_ipe_edit_control_form', $form_state);
     if (empty($form_state['executed'])) {
         // At this point, we want to save the cache to ensure that we have a lock.
         $this->cache->ipe_locked = TRUE;
         panels_edit_cache_set($this->cache);
         $this->commands[] = array('command' => 'initIPE', 'key' => $this->clean_key, 'data' => drupal_render($output), 'lockPath' => $this->get_url('unlock_ipe'));
         return;
     }
     // Check to see if we have a lock that was broken. If so we need to
     // inform the user and abort.
     if (empty($this->cache->ipe_locked)) {
         $this->commands[] = ajax_command_alert(t('A lock you had has been externally broken, and all your changes have been reverted.'));
         $this->commands[] = array('command' => 'cancelIPE', 'key' => $this->clean_key);
         return;
     }
     // Otherwise it was submitted.
     if (!empty($form_state['clicked_button']['#save-display'])) {
         // Saved. Save the cache.
         panels_edit_cache_save($this->cache);
         // A rerender should fix IDs on added panes as well as ensure style changes are
         // rendered.
         $this->meta_location = 'inline';
         $this->commands[] = ajax_command_replace("#panels-ipe-display-{$this->clean_key}", panels_render_display($this->display, $this));
     } else {
         // Cancelled. Clear the cache.
         panels_edit_cache_clear($this->cache);
     }
     $this->commands[] = array('command' => 'endIPE', 'key' => $this->clean_key);
 }
開發者ID:rexxllabore,項目名稱:acme,代碼行數:42,代碼來源:panels_renderer_ipe.class.php

示例3: ajax_save_form

 /**
  * AJAX entry point to create the controller form for an IPE.
  */
 function ajax_save_form($break = NULL)
 {
     ctools_include('form');
     if (!empty($this->cache->locked)) {
         if ($break != 'break') {
             $account = user_load($this->cache->locked->uid);
             $name = theme('username', $account);
             $lock_age = format_interval(time() - $this->cache->locked->updated);
             $message = t("This panel is being edited by user !user, and is therefore locked from editing by others. This lock is !age old.\n\nClick OK to break this lock and discard any changes made by !user.", array('!user' => $name, '!age' => $lock_age));
             $this->commands[] = array('command' => 'unlockIPE', 'message' => $message, 'break_path' => url($this->get_url('save-form', 'break')));
             return;
         }
         // Break the lock.
         panels_edit_cache_break_lock($this->cache);
     }
     $form_state = array('display' => &$this->display, 'content_types' => $this->cache->content_types, 'rerender' => FALSE, 'no_redirect' => TRUE, 'layout' => $this->plugins['layout']);
     $output = ctools_build_form('panels_ipe_edit_control_form', $form_state);
     if ($output) {
         // At this point, we want to save the cache to ensure that we have a lock.
         panels_edit_cache_set($this->cache);
         $this->commands[] = array('command' => 'initIPE', 'key' => $this->clean_key, 'data' => $output);
         return;
     }
     // no output == submit
     if (!empty($form_state['clicked_button']['#save-display'])) {
         // Saved. Save the cache.
         panels_edit_cache_save($this->cache);
     } else {
         // Cancelled. Clear the cache.
         panels_edit_cache_clear($this->cache);
     }
     $this->commands[] = array('command' => 'endIPE', 'key' => $this->clean_key, 'data' => $output);
 }
開發者ID:CalvinZhu,項目名稱:boinc,代碼行數:36,代碼來源:panels_renderer_ipe.class.php


注:本文中的panels_edit_cache_clear函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。