示例#1
0
 public static function display()
 {
     self::check_if_ie();
     Headway::load('visual-editor/display', 'VisualEditorDisplay');
     HeadwayVisualEditorDisplay::display();
 }
示例#2
0
 static function clone_pages_select_walker($pages, $depth = 0)
 {
     $return = '';
     foreach ($pages as $id => $children) {
         $layout_id_fragments = explode('-', $id);
         $status = HeadwayLayout::get_status($id);
         /* Take care of layouts that are the front page or blog index */
         if (get_option('show_on_front') === 'page' && (isset($layout_id_fragments[1]) && $layout_id_fragments[1] == 'page')) {
             /* If the page is set as the static homepage or blog page, hide it if they don't have children. */
             if (end($layout_id_fragments) == get_option('page_on_front') || end($layout_id_fragments) == get_option('page_for_posts')) {
                 /* Layout has children--add the no edit class and has children class. */
                 if (is_array($children) && count($children) !== 0) {
                     $disabled = true;
                 } else {
                     continue;
                 }
             }
         }
         /* Handle layouts that aren't customized or have a template */
         if (headway_get('customized', $status, false) === false || headway_get('template', $status, false) !== false) {
             /* If there ARE customized children, add the no-edit class */
             if (is_array($children) && count($children) !== 0) {
                 /* Check if the children are customized. */
                 if (HeadwayVisualEditorDisplay::is_any_layout_child_customized($children)) {
                     $disabled = true;
                 } else {
                     continue;
                 }
                 /* If there aren't any children, do not display the node at all */
             } else {
                 continue;
             }
         }
         /* If the current layout is selected, then make it disabled. */
         if (headway_post('layout') == $id) {
             $disabled = true;
         }
         /* Output Stuff */
         $depth_display = str_repeat('   ', $depth);
         $disabled = isset($disabled) && $disabled === true ? ' disabled="disabled"' : null;
         $return .= '<option value="' . $id . '"' . $disabled . '>' . $depth_display . HeadwayLayout::get_name($id) . '</option>';
         if (is_array($children) && count($children) !== 0) {
             $return .= self::clone_pages_select_walker($children, $depth + 1);
         }
     }
     return $return;
 }
 public static function method_get_layout_selector_templates()
 {
     $templates = HeadwayVisualEditorDisplay::list_templates();
     echo trim(str_replace(array("\n", "\t"), '', $templates));
 }