Пример #1
0
 /**
  * Configure Backend Controllers
  */
 public function before()
 {
     parent::before();
     // Configure Backend
     require_once APPPATH . 'config' . DIRECTORY_SEPARATOR . 'backend.php';
     // Navigation init
     Navigation::init(Kohana::$config->load('sitemap')->as_array());
     // Configure WebApp init data
     WebApp::set_init_data(array('is_backend' => true, 'backend_url' => URL::backend(), 'base_url' => URL::site()));
 }
Пример #2
0
 /**
  * Go to Backend URL
  *
  * @param array|string $controller
  * @param string $action
  * @param string $id
  */
 public function go_backend($controller = null, $action = null, $id = null)
 {
     $this->go(URL::backend($controller, $action, $id));
 }
Пример #3
0
		<div class="alert alert-danger alert-dark padding-xs">
		<%= __('Plugin can not be installed. The required version of the CMS: :required_version. Version of your CMS is: :current_version.', {
			':required_version': required_cms_version,
			':current_version': '<?php 
echo CMS_VERSION;
?>
'
		}) %>
		</div>
		<% } %>
		<% if (installed && settings) { %>
		<?php 
if (ACL::check('plugins.settings')) {
    ?>
		<a href="<?php 
    echo URL::backend('plugins/settings');
    ?>
/<%= id %>" class="btn btn-default btn-sm pull-right">
			<?php 
    echo UI::icon('cog');
    ?>
 <span class="hidden-xs hidden-sm"><%= __('Settings') %></span>
		</a>
		<?php 
}
?>
		<% } %>
		<h5 class="pull-left"><%= title %> <small>v<%= version %></small></h5>
		<div class="clearfix"></div>
		<% if (description) { %><p class="text-muted"><%= description %></p><% } %>
		<% if (author) { %><small class="text-light-gray text-xs"><%= __('Author') %> <%= author %></small><% } %>
Пример #4
0
<?php

defined('NEGOCORE') or die('No direct script access.');
/**
 * Skeleton Module
 *
 * @author      Iván Molina Pavana <*****@*****.**>
 * @copyright   Copyright (c) 2015, NegoCAD <*****@*****.**>
 * @version     1.0.0
 */
// --------------------------------------------------------------------------------
/**
 * Navigation config for Module sitemap
 *
 * @filesource
 * @link http://dev.negocad.mx/docs/negocore/navigation
 */
return array(array('name' => 'ModuleName', 'url' => URL::backend('module'), 'priority' => 100, 'icon' => 'globe'));
Пример #5
0
 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(), 'DATE_FORMAT' => Config::get('site', 'date_format'), 'IS_BACKEND' => IS_BACKEND, 'CLOSE_POPUP' => Session::instance()->get_once('close_popup', FALSE));
     foreach (Messages::get() as $type => $messages) {
         $this->template_js_params['MESSAGE_' . strtoupper($type)] = $messages;
     }
 }
Пример #6
0
 public function children($parent_id, $level, $return = FALSE)
 {
     $expanded_rows = Arr::get($_COOKIE, 'cms_expanded_pages');
     $expanded_rows = $expanded_rows == NULL ? array() : explode(',', $expanded_rows);
     $page = ORM::factory('page', $parent_id);
     if (!$page->loaded()) {
         return;
     }
     $pages = ORM::factory('page')->children_of($parent_id);
     $behavior = Behavior::get($page->behavior_id);
     if (!empty($behavior['limit'])) {
         $pages->limit((int) $behavior['limit']);
     }
     $childrens = $pages->find_all()->as_array('id');
     foreach ($childrens as $index => $child) {
         $childrens[$index]->has_children = $child->has_children();
         $child_behavior = Behavior::get($child->behavior_id);
         if (!empty($child_behavior['link'])) {
             $childrens[$index]->has_children = TRUE;
         }
         $childrens[$index]->is_expanded = in_array($child->id, $expanded_rows);
         if ($childrens[$index]->is_expanded === TRUE) {
             $childrens[$index]->children_rows = $this->children($child->id, $level + 1, true);
         }
     }
     if (!empty($behavior['limit'])) {
         $childrens[] = '...';
     }
     if (!empty($behavior['link'])) {
         $link = strtr($behavior['link'], array(':id' => $parent_id));
         $childrens[] = __(':icon :link', array(':icon' => UI::icon('book'), ':link' => HTML::anchor(URL::backend($link), __(ucfirst($page->behavior_id)))));
     }
     $content = View::factory('page/children', array('childrens' => $childrens, 'level' => $level + 1, 'expanded_rows' => $expanded_rows));
     if ($return === TRUE) {
         return $content;
     }
     echo $content;
 }
Пример #7
0
 /**
  * Generate a Response for the 401 Exception
  *
  * The user should be redirect to a login page.
  *
  * @return Response
  * @throws Kohana_Exception
  */
 public function get_response()
 {
     Flash::set('redirect', Request::current()->uri());
     return Response::factory()->status(401)->headers('Location', URL::backend('auth', 'login'));
 }
Пример #8
0
 /**
  * 
  * @param string $uri
  */
 public function json_redirect($uri)
 {
     $this->json['redirect'] = URL::backend($uri);
 }