public function __construct() { // This allows us to check if we're being called in the front or the back. if (defined("CMS_BACKEND")) { $this->setLayout('backend'); $this->assignToLayout("sidebar", new View("../../plugins/themer/views/sidebar")); } else { $settings = Plugin::getAllSettings("themer"); $layout = Layout::findById($settings["layout"]); $this->setLayout($layout->name); } }
function _edit($id) { $layout = Layout::findById($id); $layout->setFromData($_POST['layout']); if (!$layout->save()) { Flash::set('error', __('Layout has not been saved. Name must be unique!')); redirect(get_url('layout/edit/' . $id)); } else { Flash::set('success', __('Layout has been saved!')); Observer::notify('layout_after_edit', $layout); } // save and quit or save and continue editing? if (isset($_POST['commit'])) { redirect(get_url('layout')); } else { redirect(get_url('layout/edit/' . $id)); } }
function edit($id) { if (!($layout = Layout::findById($id))) { Flash::set('error', __('Layout not found!')); redirect(get_url('layout')); } // check if trying to save if (get_request_method() == 'POST') { return $this->_edit($id); } // display things... $this->display('layout/edit', array('csrf_token' => SecureToken::generateToken(BASE_URL . 'layout/edit'), 'action' => 'edit', 'layout' => $layout)); }
?> )</small><?php } ?> <img align="middle" alt="" class="busy" id="busy-<?php echo $child->id; ?> " src="<?php echo PATH_PUBLIC; ?> wolf/admin/images/spinner.gif" title="" /> </span> </div> <div class="page-layout"><?php $layout = Layout::findById($child->layout_id); echo isset($layout->name) ? htmlspecialchars($layout->name) : __('inherit'); ?> </div> <?php switch ($child->status_id) { case Page::STATUS_DRAFT: echo '<div class="status draft-status">' . __('Draft') . '</div>'; break; case Page::STATUS_PREVIEW: echo '<div class="status preview-status">' . __('Preview') . '</div>'; break; case Page::STATUS_PUBLISHED: echo '<div class="status published-status">' . __('Published') . '</div>'; break; case Page::STATUS_HIDDEN:
public function layout() { if ($this->layoutId()) { return Layout::findById($this->layoutId()); } else { return $this->parent()->layout(); } }
echo get_url('page/edit/1'); ?> " title="/"><img align="middle" class="icon" src="<?php echo PATH_PUBLIC; ?> wolf/admin/images/page.png" alt="page icon" /> <span class="title"><?php echo $root->title; ?> </span></a> <?php } ?> </span> </div> <div class="page-layout"><?php echo Layout::findById($root->layout_id)->name; ?> </div> <div class="status published-status"><?php echo __('Published'); ?> </div> <div class="view-page"><a href="<?php echo URL_PUBLIC; ?> " target="_blank"><img src="<?php echo PATH_PUBLIC; ?> wolf/admin/images/magnify.png" align="middle" alt="<?php echo __('View Page'); ?>