Пример #1
0
 public function __construct($data)
 {
     parent::__construct();
     __extends($this);
     $this->_config();
     $this->data = $data;
     $this->instance = get_instance();
     $this->opened_module = get_core_vars('opened_module');
     $this->data['module'] = get_core_vars('opened_module');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $fileManager = get_modules('filter_namespace', 'tendoo_contents');
     if ($fileManager) {
         include_once MODULES_DIR . $fileManager['encrypted_dir'] . '/utilities.php';
         set_core_vars('fmlib', new tendoo_contents_utility());
         // Loading library
     }
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->data['inner_head'] = $this->load->view('admin/inner_head', $this->data, true);
     $this->data['lmenu'] = $this->load->view(VIEWS_DIR . '/admin/left_menu', $this->data, true, TRUE);
     $this->link = MODULES_DIR . $this->opened_module['encrypted_dir'] . '/';
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     // ???
     $this->module_metas =& $this->opened_module;
     // ???
     // $this->load->library( 'GUI' );
 }
Пример #2
0
 public function body($data)
 {
     $this->data = array_merge($this->data, $data);
     set_core_vars('theme_header', $this->header($this->data));
     set_core_vars('theme_footer', $this->footer($this->data));
     $this->view('templates/body');
 }
Пример #3
0
 public function add_menu_core($interface, $namespace, $config)
 {
     if (in_array($interface, $this->allowed_interface)) {
         $core_menus = ($array = get_core_vars($interface . '_menus_core')) ? $array : array();
         $core_menus[$namespace][] = $config;
         return set_core_vars($interface . '_menus_core', $core_menus);
     }
     return false;
 }
Пример #4
0
 public function index()
 {
     set_page('title', $this->data['page'][0]['PAGE_TITLE']);
     set_page('description', $this->data['page'][0]['PAGE_DESCRIPTION']);
     get_core_vars('active_theme_object')->definePageTitle($this->data['page'][0]['PAGE_TITLE']);
     get_core_vars('active_theme_object')->definePageDescription($this->data['page'][0]['PAGE_DESCRIPTION']);
     set_core_vars('module_content', $this->load->view($this->data['module']['uri_path'] . '/views/common_main', $this->data, true, TRUE));
     get_core_vars('active_theme_object')->head($this->data);
     get_core_vars('active_theme_object')->body($this->data);
 }
Пример #5
0
 public function index($arg = '')
 {
     css_push_if_not_exists('font');
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     set_page('title', __('Welcome on') . ' ' . get('core_version'));
     set_core_vars('body', $this->load->the_view('tendoo_index_body', true));
     $this->load->the_view('header');
     $this->load->the_view('global_body');
 }
Пример #6
0
 public function edit($page_id)
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('page_title', __('Page Title'), 'trim|required');
     $this->form_validation->set_rules('page_id', __('Page Id'), 'trim|required');
     $this->form_validation->set_rules('page_description', __('Page description'), 'trim|required');
     $this->form_validation->set_rules('page_content', __('Content field'), 'trim|required');
     if ($this->form_validation->run()) {
         $post_page = $this->lib->set_page($this->input->post('page_title'), $this->input->post('page_content'), $this->input->post('page_description'), $this->input->post('page_parent') ? $this->input->post('page_parent') : 0, $this->input->post('page_controller_id') ? $this->input->post('page_controller_id') : 0, $process_type = 'edit', $this->input->post('page_status') ? 1 : 0, $this->input->post('page_id'));
         notice('push', fetch_notice_output($post_page));
     }
     set_page('title', __('Page creator > Create a page'));
     set_core_vars('available_controllers', $this->lib->get_available_controllers($page_id));
     set_core_vars('available_pages', $this->lib->get_pages('all_but_not', $page_id));
     set_core_vars('current_page', $this->lib->get_pages('filter_id', $page_id));
     $this->visual_editor->loadEditor(1);
     return $this->load->view($this->opened_module['uri_path'] . 'views/edit', $this->data, true, TRUE);
 }
Пример #7
0
 public function index($parameters)
 {
     // var_dump( $parameters );
     set_core_vars('pages_editor_parameters', $parameters);
     set_core_vars('pages_editor_loaded_page', $static_page = $this->lib->get_static_page($parameters), 'read_only');
     if (is_array($static_page)) {
         if (is_array(return_if_array_key_exists('THREAD', $static_page[0]))) {
             foreach ($static_page[0]['THREAD'] as $_thread) {
                 $_current_page = $this->lib->get_pages('filter_title_url', $_thread);
                 if ($_current_page) {
                     if (return_if_array_key_exists('THREAD', $_current_page[0])) {
                         set_bread(array('link' => get_instance()->url->site_url($_current_page[0]['THREAD']), 'text' => $_current_page[0]['TITLE']));
                     }
                 }
             }
         }
     }
     set_core_vars('module_content', $this->load->view($this->module['uri_path'] . '/views/common', $this->data, true, TRUE));
     get_core_vars('active_theme_object')->head($this->data);
     get_core_vars('active_theme_object')->body($this->data);
 }
Пример #8
0
 public function code($e)
 {
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     set_core_vars('code', notice('push', fetch_notice_output($e)));
     set_core_vars('body', $this->load->view('error/inner_body', $this->data, TRUE));
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     set_page('title', translate('Error - Tendoo'));
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     css_push_if_not_exists('font');
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->load->view('header', $this->data);
     $this->load->view('error/global_body', $this->data);
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 }
Пример #9
0
 public function superAdmin()
 {
     // Has Admin ?
     $this->users_global->hasAdmin() === TRUE ? $this->instance->url->redirect(array('login')) : false;
     $this->instance->form_validation->set_rules('super_admin_pseudo', __('Pseudo'), 'trim|required|min_length[5]|max_length[15]');
     $this->instance->form_validation->set_rules('super_admin_password', __('Password'), 'trim|required|min_length[6]|max_length[15]');
     $this->instance->form_validation->set_rules('super_admin_password_confirm', __('Confirm Password'), 'trim|required|min_length[6]|matches[super_admin_password]');
     $this->instance->form_validation->set_rules('super_admin_mail', __('Email'), 'trim|valid_email|required');
     $this->instance->form_validation->set_rules('super_admin_sex', __('Sex selection'), 'trim|required|min_length[3]|max_length[4]');
     if ($this->instance->form_validation->run()) {
         if ($this->instance->users_global->createSuperAdmin($this->instance->input->post('super_admin_pseudo'), $this->instance->input->post('super_admin_password'), $this->instance->input->post('super_admin_sex'), $this->instance->input->post('super_admin_mail'))) {
             $this->instance->url->redirect(array('login?notice=user-has-been-created&ref=' . urlencode($this->instance->url->site_url(array('admin', 'index')))));
         }
         notice('push', fetch_notice_output('super-admin-creation-failed'));
     }
     set_core_vars('pageTitle', __('Create Admin - Tendoo'));
     set_page('title', get_core_vars('pageTitle'));
     set_page('description', __('Create Super Admin - Tendoo'));
     set_core_vars('body', $this->load->view('registration/createSuperAdmin', true));
     $this->load->view('header');
     $this->load->view('global_body');
 }
Пример #10
0
 /**
  * 	Its create post type interface quickly. Callable from "init.php" module and theme file.
  **/
 function __construct($config)
 {
     $this->namespace = $this->config['namespace'] = riake('namespace', $config);
     // $this->meta					=	$this->config[ 'meta' ]					=	riake( 'meta' , $config ); Meta are no more white listed. They should be created using a proper form to be saved as meta data.
     $this->label = $this->config['label'] = riake('label', $config, $this->namespace);
     $this->new_post_label = $this->config['new-post-label'] = riake('new-post-label', $config, sprintf(__('Create a new %s'), $this->namespace));
     $this->edit_post_label = $this->config['edit-post-label'] = riake('edit-post-label', $config, sprintf(__('Edit %s'), $this->namespace));
     $this->posts_list_label = $this->config['posts-list-label'] = riake('posts-list-label', $config, sprintf(__('%s list'), $this->namespace));
     $this->delete_post_label = $this->config['delete-post-label'] = riake('delete-post-label', $config, sprintf(__('delete %s'), $this->namespace));
     $this->menu_position = $this->config['menu-position'] = riake('menu-position', $config, array('after', 'dashboard'));
     $this->menu_icon = $this->config['menu-icon'] = riake('menu-icon', $config, 'fa fa-star');
     $this->privilege = $this->config['privilege'] = riake('privilege', $config, 'system@manage_modules');
     $this->displays = $this->config['displays'] = riake('displays', $config, array('title', 'editor', 'publish'));
     $this->comment_enabled = $this->config['comment-enabled'] = riake('comment-enabled', $config, TRUE);
     $this->post_comment_label = $this->config['post-comment-label'] = riake('post-comment-label', $config, __('Comments'));
     $this->comments_list_label = $this->config['comments-list-label'] = riake('comments-list-label', $config, sprintf(__('%s comments'), $this->namespace));
     if (!$this->namespace) {
         return false;
     }
     $this->query = new CustomQuery(array('namespace' => $this->namespace));
     $posttypes = get_core_vars('posttypes');
     $posttypes[$this->namespace] = $this;
     set_core_vars('posttypes', $posttypes);
 }
Пример #11
0
/**
 * Register Fields for custom forms
 *
 * @params String, form name
 * @params Array, data to register
 * @return void
 **/
function register_fields($form_name, $config)
{
    /**
     *	Config form
     * 	array( 
     *		'name'		=>	'example', // a valid index of POST[ 'example' ]
     *		'purify'	=>	function( $value ){
     *			return $value
     *		}
     *	)
     **/
    $fields_registered = riake('registered_fields', get_core_vars(), array());
    $fields_registered[$form_name][] = $config;
    set_core_vars('registered_fields', $fields_registered);
}
Пример #12
0
/**
*	push_core_vars : ajoute une nouvelle valeur à un tableau déjà existant dans le tableau du noyau
*  Deprecated
**/
function push_core_vars($key, $var, $value = null)
{
    $vars = get_core_vars($key);
    if ($vars) {
        if ($value != null) {
            $vars[$var] = $value;
            return set_core_vars($key, $vars);
        } else {
            $vars[] = $var;
            return set_core_vars($key, $vars);
        }
    } else {
        // if value is not set create an array
        $vars = array();
        if ($value != null) {
            $vars[$var] = $value;
            return set_core_vars($key, $vars);
        } else {
            $vars[] = $var;
            return set_core_vars($key, $vars);
        }
    }
    return false;
}
Пример #13
0
 public function passchange($email, $timestamp, $password)
 {
     if ($timestamp > $this->instance->date->timestamp()) {
         if ($this->users_global->emailExist($email)) {
             // Library
             $this->load->library('Tendoo_admin');
             if (riake('allow_registration', $this->options) == "0") {
                 $this->url->redirect(array('error', 'code', 'registration-disabled'));
             }
             $connect = $this->users_global->emailConnect($email, $password);
             if ($connect) {
                 $this->load->library('form_validation');
                 $this->form_validation->set_rules('password_new', translate('New password'), 'trim|required|min_length[6]|max_length[30]');
                 $this->form_validation->set_rules('password_new_confirm', translate('Confirm password'), 'trim|required|matches[password_new]');
                 if ($this->form_validation->run()) {
                     $query = $this->users_global->recoverPassword($connect['ID'], $password, $this->input->post('password_new'));
                     if ($query == 'password-has-changed') {
                         $this->url->redirect(array('login?notice=' . $query));
                     } else {
                         notice(fetch_notice_output($query));
                     }
                 }
                 set_core_vars('pageTitle', translate('Changing Password - Tendoo'));
                 set_page('title', get_core_vars('pageTitle'));
                 set_core_vars('menu', $this->load->view('login/recovery_menu', true));
                 set_core_vars('body', $this->load->view('login/password_change', true));
                 $this->load->the_view('header');
                 $this->load->the_view('global_body');
             } else {
                 $this->url->redirect(array('error', 'code', 'activation-failed'));
             }
         } else {
             $this->url->redirect(array('error', 'code', 'unknow-email'));
         }
     } else {
         $this->url->redirect(array('error', 'code', 'expiration-time-reached'));
     }
 }
Пример #14
0
function _set_module_vars($namespace, $key, $value)
{
    $declared_modules = get_core_vars(_get_app_declaration_prefix() . 'declared_modules');
    $declared_modules[$namespace][$key] = $value;
    return set_core_vars(_get_app_declaration_prefix() . 'declared_modules', $declared_modules);
}
Пример #15
0
 public function step($i = 1, $e = '')
 {
     // $this->instance->lang->defineLang('en_US');
     if ($this->lang->isLangSelected()) {
         // $this->url->redirect(array('install','defineLang'));
     }
     $this->data['step'] = $i;
     $this->data['InstallError'] = '';
     set_core_vars('step', $i);
     if ($i == 1) {
         // Skip this step
         $_SESSION['secur_access'] = 2;
         $this->url->redirect(array('install', 'step', 2));
         // Skip this step
         $_SESSION['secur_access'] = 1;
         if (isset($_POST['submit'])) {
             $_SESSION['secur_access'] = 2;
             $this->url->redirect(array('install', 'step', 2));
         }
         set_page('title', translate(sprintf('Installing Tendoo : ', get('core_id'))));
         $this->load->view('header', $this->data);
         $this->load->view('install/step/1/homebody', $this->data);
     } else {
         if ($i == 2) {
             if (!isset($_SESSION['secur_access'])) {
                 $this->url->redirect(array('install', 'step', 1));
             } else {
                 if (!in_array($_SESSION['secur_access'], array(1, 2))) {
                     $this->url->redirect(array('install', 'step', 1));
                 }
             }
             if (isset($_POST['host_name'], $_POST['user_name'])) {
                 $this->form_validation->set_rules('host_name', __('Host name'), 'trim|required');
                 $this->form_validation->set_rules('user_name', __('Use name'), 'trim|required');
                 // $this->form_validation->set_rules('host_password','mot de passe','trim|required'); // to allow empty password usage.
                 $this->form_validation->set_rules('db_name', __('Database name'), 'trim|required');
                 $this->form_validation->set_rules('db_type', __('Server type'), 'trim|required');
                 $this->form_validation->set_rules('extension_name', __('Tables extension'), 'trim|required');
                 if ($this->form_validation->run()) {
                     $connexion = $this->installation->attempt_db_connection($this->input->post('host_name'), $this->input->post('user_name'), $this->input->post('host_password'), $this->input->post('db_name'), $this->input->post('db_type'), $this->input->post('extension_name'));
                     if ($connexion === TRUE) {
                         $_SESSION['secur_access'] = 3;
                         $this->url->redirect(array('install', 'step', 3));
                     }
                 }
             }
             set_page('title', sprintf(translate('%s ­ Setting Database Information'), get('core_version')));
             set_core_vars('body', $this->load->the_view('install/step/2/homebody', true));
             $this->load->the_view('header', $this->data);
             $this->load->the_view('global_body');
         } else {
             if ($i == 3) {
                 if (isset($_SESSION['db_datas'])) {
                     if (!isset($_SESSION['secur_access'])) {
                         $this->url->redirect('install/step/2/secur_access_not_defined');
                     } else {
                         if (!in_array($_SESSION['secur_access'], array(1, 2, 3))) {
                             $this->url->redirect('install/step/1');
                         }
                     }
                     set_page('title', sprintf(translate('%s ­ Providing Website name'), get('core_version')));
                     set_core_vars('body', $this->load->the_view('install/step/3/homebody', true));
                     $this->load->the_view('header', $this->data);
                     $this->load->the_view('global_body');
                 } else {
                     $this->url->redirect('install/step/2/installError');
                 }
             }
         }
     }
 }
Пример #16
0
 public function comments_manage($id)
 {
     if (current_user_can('blogster_manage_comments@blogster')) {
         $this->load->library('form_validation');
         if (isset($_POST['approve'])) {
             $this->form_validation->set_rules('hiddenId', 'Identifiant du commentaire', 'trim|required|min_length[1]');
             if ($this->form_validation->run()) {
                 if ($this->news->approveComment($this->input->post('hiddenId'))) {
                     notice('push', fetch_notice_output('done'));
                 } else {
                     notice('push', fetch_notice_output('error-occured'));
                 }
             }
         } else {
             if (isset($_POST['disapprove'])) {
                 $this->form_validation->set_rules('hiddenId', 'Identifiant du commentaire', 'trim|required|min_length[1]');
                 if ($this->form_validation->run()) {
                     if ($this->news->disapproveComment($this->input->post('hiddenId'))) {
                         notice('push', fetch_notice_output('done'));
                     } else {
                         notice('push', fetch_notice_output('error-occured'));
                     }
                 }
             } else {
                 if (isset($_POST['delete'])) {
                     $this->form_validation->set_rules('hiddenId', 'Identifiant du commentaire', 'trim|required|min_length[1]');
                     if ($this->form_validation->run()) {
                         if ($this->news->deleteComment($this->input->post('hiddenId'))) {
                             $this->url->redirect(array('admin', 'open', 'modules', $this->opened_module['namespace'], 'comments?notice=commentDeleted'));
                         }
                     }
                 }
             }
         }
         set_core_vars('speComment', $this->news->getSpeComment($id));
         if (!get_core_vars('speComment')) {
             $this->url->redirect(array('admin', 'open', 'modules', $this->opened_module['namespace'], 'comments?notice=unknowComments'));
         }
         // redirect if comment doesn't exist.
         set_page('title', __('Blogster - Manage Comments'));
         $this->load->view(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/views/manage_comments', $this->data, false, TRUE);
     } else {
         $this->url->redirect(array('admin', 'index?notice=accessDenied'));
     }
 }
Пример #17
0
 public function tags($tags_name = '', $page = 1)
 {
     $this->data['keyWords'] = $this->news->keyWordExists($tags_name, 'filter_url_title');
     if (!$this->data['keyWords']) {
         module_location(array('index?notice=unknowKeyWord'));
     }
     $this->data['countArticles'] = count($this->news->getKeyWordsArticles($this->data['keyWords'][0]['ID'], null, null, 'filter_id'));
     $this->data['paginate'] = pagination_helper(10, $this->data['countArticles'], $page, module_url(array('tags')), $RedirectUrl = array('error', 'code', 'page-404'));
     $this->data['tagArticles'] = $this->data['news']->getKeyWordsArticles($this->data['keyWords'][0]['URL_TITLE'], $this->data['paginate']['start'], $this->data['paginate']['end'], 'filter_url_title');
     //
     $title = $this->data['page'][0]['PAGE_TITLE'] . ' » ' . $this->data['keyWords'][0]['TITLE'] . ' (mot-clé)';
     $description = strip_tags($this->data['keyWords'][0]['DESCRIPTION']);
     // Fetching KeyWords Description
     //
     set_page('title', $title);
     set_page('description', $description);
     //
     get_core_vars('active_theme_object')->definePageTitle($title);
     get_core_vars('active_theme_object')->definePageDescription($description);
     //
     if ($this->data['tagArticles'] == false) {
         $this->data['tagArticles'] = array(array('TITLE' => 'Aucune publication disponible', 'CONTENT' => 'Aucune publication n\'est disponible pour ce mot-clé', 'AUTEUR' => '1', 'DATE' => get_instance()->date->datetime(), 'THUMB' => $this->url->img_url('hub_back.png'), 'IMAGE' => $this->url->img_url('hub_back.png'), 'ID' => 0));
     }
     $this->data['section'] = 'keywords';
     set_core_vars('module_content', $this->load->view(MODULES_DIR . $this->data['module']['encrypted_dir'] . '/views/common_keywords', $this->data, true, TRUE));
     // ----------------------------------------------------------------------------------------------------------------------------------//
     get_core_vars('active_theme_object')->head($this->data);
     get_core_vars('active_theme_object')->body($this->data);
 }
Пример #18
0
 public function users($options = '', $x = 1, $y = '', $z = '')
 {
     current_user()->cannot('system@manage_users') ? $this->url->redirect(array('admin', 'index?notice=accessDenied')) : false;
     if ($options == 'create') {
         $this->form_validation->set_rules('admin_pseudo', translate('Pseudo'), 'trim|required|min_length[5]|max_length[15]');
         $this->form_validation->set_rules('admin_password', translate('Password'), 'trim|required|min_length[6]|max_length[30]');
         $this->form_validation->set_rules('admin_password_confirm', translate('Password Confirm'), 'trim|required|matches[admin_password]');
         $this->form_validation->set_rules('admin_sex', translate('Sex'), 'trim|min_length[3]|max_length[5]');
         $this->form_validation->set_rules('admin_password_email', translate('email'), 'trim|valid_email|required');
         $this->form_validation->set_rules('admin_privilege', translate('Select privilege'), 'trim|required');
         if ($this->form_validation->run()) {
             $creation_status = $this->users_global->createAdmin($this->input->post('admin_pseudo'), $this->input->post('admin_password'), $this->input->post('admin_sex'), $this->input->post('admin_privilege'), $this->input->post('admin_password_email'));
             switch ($creation_status) {
                 case 'notAllowedPrivilege':
                     notice('push', fetch_notice_output('users-creation-failed'));
                     break;
                 case 'user-has-been-created':
                     $this->url->redirect(array('admin', 'users?notice=user-has-been-created'));
                     break;
                 case 'users-creation-failed':
                     $this->url->redirect(array('admin', 'users', 'create?notice=users-creation-failed'));
             }
         }
         set_core_vars('getPrivs', $this->roles->get());
         set_page('title', translate('Manage Users - Tendoo'));
         $this->load->the_view('admin/users/create');
     } else {
         if ($options == 'edit') {
             if ($this->input->post('set_admin')) {
                 $this->form_validation->set_rules('current_admin', translate('About current user'), 'trim|required|min_length[5]');
                 $this->form_validation->set_rules('edit_priv', translate('Edit his privilege'), 'trim|required');
                 $this->form_validation->set_rules('user_email', translate('Email'), 'trim|valid_email');
                 if ($this->form_validation->run()) {
                     $query = $this->users_global->setAdminPrivilege($this->input->post('edit_priv'), $this->input->post('current_admin'), $this->input->post('user_email'));
                     notice('push', fetch_notice_output($query));
                 }
             }
             if ($this->input->post('delete_admin')) {
                 $this->form_validation->set_rules('current_admin', translate('About current user'), 'trim|required|min_length[5]');
                 $this->form_validation->set_rules('delete_admin', translate('Edit his privilege'), 'trim|required|min_length[1]');
                 if ($this->form_validation->run()) {
                     if ($this->users_global->deleteSpeAdmin($this->input->post('current_admin'))) {
                         $this->url->redirect(array('admin', 'users?notice=adminDeleted'));
                     } else {
                         notice('push', fetch_notice_output('error-occured'));
                     }
                 }
             }
             set_core_vars('get_roles', $this->roles->get());
             set_core_vars('adminInfo', $adminInfo = $this->users_global->getSpeAdminByPseudo($x));
             set_page('title', sprintf(translate('User profile : %s - Tendoo'), $adminInfo['PSEUDO']));
             $this->load->the_view('admin/users/edit');
         } else {
             set_core_vars('users_nbr', count($this->users_global->getAdmin()));
             set_core_vars('paginate', $paginate = $this->tendoo->paginate(10, get_core_vars('users_nbr'), 1, 'bg-color-red fg-color-white', '', $x, $this->url->site_url(array('admin', 'system', 'users')) . '/'));
             set_core_vars('get_users', $this->users_global->getAdmin($paginate[1], $paginate[2]));
             set_page('title', translate('Manage users - Tendoo'));
             $this->load->the_view('admin/users/users');
         }
     }
 }
Пример #19
0
 /**
  * General Error Page
  *
  * This function takes an error message as input
  * (either as a string or an array) and displays
  * it using the specified template.
  *
  * @access	private
  * @param	string	the heading
  * @param	string	the message
  * @param	string	the template name
  * @param 	int		the status code
  * @return	string
  */
 function show_error($heading, $message, $template = 'error_general', $status_code = 500)
 {
     set_core_vars('error', $message);
     set_core_vars('body', get_instance()->load->the_view('warning', true));
     get_instance()->load->the_view('header');
     get_instance()->load->the_view('global_body');
 }
Пример #20
0
function set_active_theme_vars($key, $value)
{
    $active_theme = get_core_vars('active_theme');
    if ($active_theme) {
        $active_theme[$key] = $value;
        return set_core_vars('active_theme', $active_theme);
    }
    return false;
}
Пример #21
0
 public function boot()
 {
     if ($this->db_connect()) {
         $this->date = new Tdate();
         $this->meta_datas = new Meta_datas();
     }
     /* =-=-=-=-=-=-=-=-= URI HANDLER	-=-=-=-=-=-=-=-=-=-= */
     set_core_vars('base_url', $baseUrl = $this->url->site_url(array('index')));
     set_core_vars('controller', $Class = $this->url->controller());
     set_core_vars('method', $Method = $this->url->method());
     set_core_vars('parameters', $Parameters = $this->url->parameters());
     /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
     /**
      * Check out if current server support tendoo
      **/
     is_compatible();
     /**
      * Load module and Themes if tendoo is installed
      **/
     if ($this->is_installed === true) {
         // Load Themes Only if Website mode is enabled.
         if (get_core_vars('tendoo_mode') !== 'website') {
             load_themes();
         }
         load_modules();
     }
     /**
      * Load Core Vars
      **/
     new Load_Core_Values($this->is_installed);
     /**
      * Checking Controller
      **/
     if (in_array($Class, array('install', 'registration', 'logoff', 'admin', 'login', 'error'))) {
         $Class === 'admin' ? define('SCRIPT_CONTEXT', 'ADMIN') : define('SCRIPT_CONTEXT', 'PUBLIC');
         if ($this->is_installed) {
             if ($this->db_connected()) {
                 include_once CONTROLLERS_DIR . $Class . '.php';
                 include_once SYSTEM_DIR . 'Executer.php';
             } else {
                 $this->tendoo->error('db_connect_error');
                 die;
             }
         } else {
             if ($Class === 'install') {
                 include_once CONTROLLERS_DIR . $Class . '.php';
                 include_once SYSTEM_DIR . 'Executer.php';
             } else {
                 $this->url->redirect(array('install'));
             }
         }
     } else {
         // Define Script context
         define('SCRIPT_CONTEXT', 'PUBLIC');
         // Checks install status
         if (!$this->is_installed) {
             include_once CONTROLLERS_DIR . 'tendoo_index.php';
             include_once SYSTEM_DIR . 'Executer.php';
         } else {
             /**
              * Attemps connecting to database
              **/
             !$this->db_connected() ? $this->tendoo->error('db_connect_error') : null;
             $options = get_core_vars('options');
             /**
              * Loading Users Class
              **/
             $this->load->library('users_global');
             // Conditional if webmode is enabled
             get_core_vars('tendoo_mode') == 'webapp' ? $this->url->redirect(array('admin', 'index?notice=web-app-mode-enabled')) : null;
             /**
              * Setting Core vars
              **/
             set_core_vars('controllers', $loaded_controllers = $this->controller->get('', FALSE), 'readonly');
             // ??
             set_core_vars('page', $unique_controller = $this->controller->_get($Class), 'readonly');
             set_core_vars('active_theme', $active_theme = get_themes('filter_active'));
             set_core_vars('module_url', $module_url = $Class, 'readonly');
             set_core_vars('module', $module = get_modules('filter_active_namespace', $unique_controller[0]['PAGE_MODULES']), 'readonly');
             set_core_vars('opened_module', $module, 'readonly');
             set_core_vars('app_module', $app_module = get_modules('filter_active_app'), 'readonly');
             /**
              * 	Trigger each init.php file within module and theme folders
              *	init.php is the main file for modules and themes.
              *	@since 1.4
              **/
             $this->trigger_inits();
             /**
              * 	Declare Notices : Notices are internal(system) or module/theme alert.
              **/
             set_core_vars('tendoo_notices', trigger_filters('declare_notices', array(get_core_vars('default_notices'))));
             // @since 1.4
             if (is_string($unique_controller)) {
                 $this->url->redirect(array('error', 'code', $unique_controller));
             } else {
                 // If selected module is valid
                 if (!$module) {
                     $this->url->redirect(array('error', 'code', 'moduleBug'));
                 }
                 /**
                  * Setting page meta datas
                  **/
                 set_page('title', $unique_controller[0]['PAGE_TITLE']);
                 set_page('description', $unique_controller[0]['PAGE_DESCRIPTION']);
                 set_page('keywords', $unique_controller[0]['PAGE_KEYWORDS']);
                 // Saved First BreadCrumbs
                 $INDEX = $this->controller->_get('index');
                 set_bread(array('link' => $module_url, 'text' => $INDEX[0]['PAGE_NAMES']));
                 /**
                  * Checks if current module is supported by active theme
                  **/
                 if (TRUE !== does_active_theme_support($module['handle'])) {
                     $this->url->redirect(array('error', 'code', 'unsupported-by-current-theme'));
                 }
                 if ($module_url == 'noMainPage') {
                     $this->url->redirect(array('error', 'code', 'noMainPage'));
                 }
                 if ($active_theme == FALSE) {
                     $this->url->redirect(array('error', 'code', 'no-theme-installed'));
                 } else {
                     // Load theme handler file
                     include_if_file_exists($active_theme['uri_path'] . '/handler.php');
                     if (class_exists($active_theme['namespace'] . '_theme_handler')) {
                         eval('set_core_vars("active_theme_object",new ' . $active_theme['namespace'] . '_theme_handler());');
                         // Initialize Theme handler;
                     } else {
                         $this->url->redirect(array('error', 'code', 'themeCrashed'));
                     }
                     $TENDOO_MODULE = $module;
                     $Class = $module['namespace'];
                     // REAFFECT CLASS VALUE DUE TO EXISTENT MODULE CLASS
                     include_if_file_exists(MODULES_DIR . $module['encrypted_dir'] . '/library.php');
                     include_once MODULES_DIR . $module['encrypted_dir'] . '/frontend.php';
                 }
                 include_once SYSTEM_DIR . 'Executer.php';
                 /// MODULE EXECUTER
             }
         }
     }
 }
Пример #22
0
 /**
  * Register vars if tendoo is installed
  *
  * @since 1.4
  * @return void
  * @access private
  **/
 private function db_vars()
 {
     /**
      * Check tendoo mode and redirect if webmode is enabled, since frontend is also disabled while webapp mode is enabled
      **/
     set_core_vars('tendoo_mode', riake('tendoo_mode', get_core_vars('options'), 'website'), 'readonly');
     set_core_vars('active_theme', site_theme());
     set_core_vars('options', $this->options = get_meta('all'), 'read_only');
     set_core_vars('tendoo_mode', riake('tendoo_mode', get_core_vars('options'), 'website'), 'readonly');
 }
Пример #23
0
" namespace="<?php 
                            echo $panel['namespace'];
                            ?>
">
                            <header class="box-header">
                            	<div class="box-tools pull-right">
                                    <button class="btn btn-default btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                </div>
                                <h3 class="box-title"><?php 
                            echo riake('title', $panel);
                            ?>
</h3>
							</header>
                            <div class="box-body clearfix">
                                <?php 
                            set_core_vars('panel', $panel);
                            $this->load->view('dashboard/others/gui_items');
                            ?>
                            </div>
                            <?php 
                            // If pagination is defined
                            if (get_core_vars('pagination_data')) {
                                ?>
							<div class="box-footer clearfix">
                              <?php 
                                bs_pagination(get_core_vars('pagination_data'), $additionnal_class = "pagination pagination-sm no-margin pull-right");
                                ?>
                            </div>
                                <?php 
                            }
                            ?>
Пример #24
0
 public function push_to($cols)
 {
     if (is_numeric($cols)) {
         $saved_meta = get_core_vars('gui_saved_meta');
         $this->saved_meta = $saved_meta;
         // Seul les méta correctement définie peuvent être ajoutés à une colonne
         if ($saved_meta) {
             if (in_array($cols, array(1, 2, 3, 4))) {
                 $this->cols[$cols]['configs'][] = $saved_meta;
             }
         }
     } else {
         if (is_string($cols)) {
             $new_items = get_core_vars('gui_saved_items');
             //
             set_core_vars('gui_saved_items', false);
             // On parcours chaque colonnes
             foreach ($this->cols as &$colones) {
                 // Si la colonne a une configuration
                 if (is_array(riake('configs', $colones, false))) {
                     foreach ($colones['configs'] as &$configs) {
                         if (is_array($configs)) {
                             foreach ($configs as $key => &$metas) {
                                 if ($key == $cols) {
                                     $saved_items = riake('meta_items', $metas, array());
                                     $saved_items[] = $new_items;
                                     $metas['meta_items'] = $saved_items;
                                     // Coz we do need unique namespace per metas, we just get out after first meet
                                     break;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }