public function action_settings() { $this->set_title(__('Settings')); Assets::package('ace'); $site_pages = array(); foreach (Model_Navigation::get()->sections() as $section) { foreach ($section->get_pages() as $item) { $url = trim(str_replace(ADMIN_DIR_NAME, '', $item->url()), '/'); $site_pages[$section->name()][$url] = $item->name(); } } $this->template->content = View::factory('system/settings', array('filters' => Arr::merge(array('--none--'), WYSIWYG::findAll()), 'dates' => Date::formats(), 'site_pages' => $site_pages, 'default_status_id' => array(Model_Page::STATUS_DRAFT => __('Draft'), Model_Page::STATUS_PUBLISHED => __('Published')))); }
public function action_edit() { $snippet_name = $this->request->param('id'); $snippet = new Model_File_Snippet($snippet_name); if (!$snippet->is_exists()) { if (($found_file = $snippet->find_file()) !== FALSE) { $snippet = new Model_File_Snippet($found_file); } else { Messages::errors(__('Snippet not found!')); $this->go(); } } $this->template->title = __('Edit snippet'); $this->breadcrumbs->add($snippet_name); // check if trying to save if (Request::current()->method() == Request::POST and ACL::check('snippet.edit')) { return $this->_edit($snippet_name); } Assets::package('ace'); $this->template->content = View::factory('snippet/edit', array('action' => 'edit', 'filters' => WYSIWYG::findAll(), 'snippet' => $snippet)); }
/** * * @return array */ public static function html_select() { $filters = array('' => __('none')); foreach (WYSIWYG::findAll() as $filter) { $filters[$filter] = Inflector::humanize($filter); } return $filters; }
public function init_media() { $this->template_js_params = array('CURRENT_URL' => Request::current()->url(TRUE) . URL::query(), 'BASE_URL' => URL::backend(ADMIN_DIR_NAME, TRUE), 'SITE_URL' => URL::base(TRUE), 'ADMIN_DIR_NAME' => ADMIN_DIR_NAME, 'ADMIN_RESOURCES' => ADMIN_RESOURCES, 'PUBLIC_URL' => PUBLIC_URL, 'LOCALE' => I18n::lang(), 'CONTROLLER' => strtolower(Request::current()->controller()), 'ACTION' => Request::current()->action(), 'USER_ID' => Auth::get_id(), 'FILTERS' => WYSIWYG::findAll(), 'DATE_FORMAT' => Config::get('site', 'date_format'), 'IS_BACKEND' => IS_BACKEND); foreach (Messages::get() as $type => $messages) { $this->template_js_params['MESSAGE_' . strtoupper($type)] = $messages; } }
<% } %> <?php echo UI::button(__('Remove part :part_name', array(':part_name' => '<%= name %>')), array('class' => 'item-remove btn-xs btn-danger', 'icon' => UI::icon('trash-o'))); ?> </div> </div> <?php } else { ?> <select class="item-filter" name="part_filter"> <option value="">– <?php echo __('--- none ---'); ?> –</option> <?php foreach (WYSIWYG::findAll() as $filter) { ?> <option value="<?php echo $filter; ?> " <% if (filter_id == "<?php echo $filter; ?> ") { print('selected="selected"')} %> ><?php echo Inflector::humanize($filter); ?> </option> <?php } ?>