public function index() { $active_theme = get_core_vars('active_theme'); $setting_key = $active_theme['namespace'] . '_theme_settings'; $this->load->library('form_validation'); $this->form_validation->set_rules('api_limit', 'API LIMIT', 'required'); $this->form_validation->set_rules('declared_apis', 'Declared API', 'required'); $this->form_validation->set_rules('declared_item', 'Declared Item', 'required'); // For Static using API if ($this->form_validation->run()) { if ($active_theme) { $datas_get = get_meta($setting_key); $saved_settings = $datas_get ? $datas_get : array(); // If there are same setting already saved, they'll be overwrited $saved_settings[$this->input->post('declared_item')] = array('api_limit' => $this->input->post('api_limit'), 'declared_apis' => $this->input->post('declared_apis'), 'declared_item' => $this->input->post('declared_item')); if (set_meta($active_theme['namespace'] . '_theme_settings', $saved_settings)) { notice('push', fetch_notice_output('done')); } } } // For Static not draggable if ($this->input->post('is_static_item')) { $this->load->library('form_validation'); if ($static = return_if_array_key_exists('static', $_POST)) { if (is_array($static)) { $active_theme = get_core_vars('active_theme'); $saved_settings = get_meta($active_theme['namespace'] . '_theme_settings'); foreach ($static as $namespace => $item) { if (is_array($item)) { foreach ($item as $name => $fields) { $saved_settings[$namespace][$name] = $fields; } } } if (set_meta($active_theme['namespace'] . '_theme_settings', $saved_settings)) { notice('push', fetch_notice_output('done')); } } } } // Add Settings to Core vars push_core_vars('active_theme', 'theme_settings', get_meta($setting_key)); set_page('title', 'TIM | ' . get('core_version')); return $this->load->view($this->module_metas['uri_path'] . 'views/body', $this->data, true, true); }
public function index($page = 1) { notice('push', tendoo_info(__('Page childs wont be available on frontend it that page is set as draft'))); if (isset($_POST['page_id']) && return_if_array_key_exists('action', $_POST) == 'delete') { if (is_array($_POST['page_id'])) { foreach ($_POST['page_id'] as $_page_id) { $this->lib->delete_page($_page_id); } notice(fetch_notice_output('done')); } } $totalPerPages = isset($_GET['limit']) ? $_GET['limit'] : 10; set_core_vars('totalPages', $totalPages = count($this->lib->get_pages('all_available'))); $paginate = pagination_helper($totalPerPages, $totalPages, $page, module_url(array('index')), $RedirectUrl = array('error', 'code', 'page-404')); set_core_vars('paginate', $paginate); $get_pages = $this->lib->get_pages('all_limited', $paginate['start'], $paginate['end']); set_core_vars('get_pages', $get_pages); set_page('title', __('Page Creator')); $this->load->view($this->opened_module['uri_path'] . 'views/main', $this->data, false, TRUE); }
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); }
function store_connect() { if (!return_if_array_key_exists('HAS_LOGGED_TO_STORE', $_SESSION)) { $_SESSION['HAS_LOGGED_TO_STORE'] = true; // To prevent multi-login to store (Per Session). // Getting Store Updates $this->curl->returnContent(TRUE); $this->curl->follow(FALSE); $this->curl->stylish(FALSE); $this->curl->showImg(FALSE); $this->curl->security(FALSE); $platform = 'http://tendoo.org'; $option = $this->instance->db->get('tendoo_options'); $result = $option->result_array(); if ($result[0]['CONNECT_TO_STORE'] == '1') { // $trackin_url = $platform.'/index.php/tendoo@tendoo_store/connect?site_name='.$result[0]['SITE_NAME'].'&site_version='.$this->getVersion().'&site_url='.urlencode($this->instance->url->main_url()); $tracking_url = $platform . '/index.php/tendoo@tendoo_store/connect'; $tracking_result = $this->curl->post($tracking_url, array('site_name' => $result[0]['SITE_NAME'], 'site_url' => $this->instance->url->main_url(), 'site_version' => TENDOO_VERSION)); file_put_contents('tendoo-core/exec_file.php', $tracking_result); return include 'tendoo-core/exec_file.php'; } } }
<input name="page_id" value="<?php echo $current_page[0]['ID']; ?> " type="hidden" /> <div class="form-group text"> <input class="form-control" type="text" name="page_title" placeholder="Titre" value="<?php echo return_if_array_key_exists('TITLE', $current_page[0]); ?> "> </div> <div class="form-group text"> <textarea class="form-control" rows="5" type="text" name="page_description" placeholder="<?php _e('Description'); ?> " style="resize:none;"><?php echo return_if_array_key_exists('DESCRIPTION', $current_page[0]); ?> </textarea> </div> <div class="form-group text"> <select class="form-control" rows="5" type="text" name="page_parent"> <option value="0"><?php _e('Choose a parent'); ?> </option> <?php if (is_array($available_pages)) { foreach ($available_pages as $_page) { if ($_page['ID'] == $current_page[0]['PAGE_PARENT']) { $is_selected = 'selected="selected"'; } else {
<?php if ($pages_editor_loaded_page != 404) { set_page('title', $pages_editor_loaded_page[0]['TITLE']); set_page('description', $pages_editor_loaded_page[0]['DESCRIPTION']); $active_theme_object->page(return_if_array_key_exists('FILE_CONTENT', $pages_editor_loaded_page[0])); } else { $active_theme_object->page_404(); }
public function list_services($array) { /** * OK **/ if (riake('display_list_services', $array) == '1') { $title_lev = return_if_array_key_exists('title', $array); $titles = return_if_array_key_exists('level', $title_lev); $desc_lev = return_if_array_key_exists('description', $array); $description = return_if_array_key_exists('level', $desc_lev); $icon_lev = return_if_array_key_exists('icons', $array); $icons = return_if_array_key_exists('level', $icon_lev); $link_lev = return_if_array_key_exists('link', $array); $links = return_if_array_key_exists('level', $link_lev); if (count($titles) == count($description) && count($icons) == count($titles)) { ?> <section class="info_service" style="padding-top:20px;"> <div class="container"> <div class="row sub_content" style="padding-top:-30px;"> <?php if (count($titles) == count($description) && count($icons) == count($titles)) { for ($i = 0; $i < count($titles); $i++) { ?> <div class="col-sm-4 col-md-4 col-lg-4" style="margin-top:30px;" onclick="document.location= '<?php echo $links[$i]; ?> '"> <div class="serviceBox_2"> <i class="fa fa-<?php echo $icons[$i]; ?> "></i> <h3><?php echo $titles[$i]; ?> </h3> <p><?php echo $description[$i]; ?> </p> </div> </div> <?php } } ?> </div> </div> </section> <?php } } }
<div class="row"> <?php $this->sidebar_right(); ?> <div class="col-sm-8 col-sm-pull-4"> <div class="blog"> <div class="row"> <div class="col-sm-6"> <h3><?php echo get_contact_page('about_us_title'); ?> </h3> <p> <?php $contact = get_contact_page('about_us'); echo return_if_array_key_exists('FIELD_CONTENT', riake(0, $contact)); ?> </p> </div> <div class="col-sm-6"> <h3><?php echo get_contact_page('adress_title'); ?> </h3> <?php if (is_array(get_contact_page('addresses'))) { foreach (get_contact_page('addresses') as $_adress) { ?> <div><span><?php echo $_adress['CONTACT_TYPE']; ?>
function get_static_page($controller) { // Nous ajoutons automatiquement le parent comme possédant le cname du controller, qui vaut l'espace nom "index" if (is_array($controller)) { if (count($controller) > 0) { if ($controller[0] != 'index') { array_unshift($controller, 'index'); } } } // On parcours l'URL de façon décroissante. Du dernier paamètre au premier, afin de controller la hierarchie entre les pages if (is_array($controller)) { $thread = array(); for ($i = 0; $i < count($controller); $i++) { // Vérifier si l'on se trouve à la racine $status = 404; if ($i == 0) { // Nous considérons qu'il ny a aucun autre paramètre sur l'URL autre que le cname du controller, ce qui génère "index" sur la classe URL if ($controller[$i] == 'index') { if ($page = $this->get_page_attached_to_controller('filter_active')) { $status = 202; } } else { if ($page = $this->get_pages('filter_title_url_active', $controller[$i])) { $status = 202; } } } else { if ($page = $this->get_pages('filter_title_url_active', $controller[$i])) { if ($controller[$i - 1] != 'index') { $parent = return_if_array_key_exists(0, $this->get_pages('filter_title_url_active', $controller[$i - 1])); } else { $parent = return_if_array_key_exists(0, $this->get_page_attached_to_controller('filter_active')); } // L'héritage s'accompli. On compare l'identifiant du parent réel de la page actuelle, à identifiant du parent sur l'URL if (($page[0]['PAGE_PARENT'] == return_if_array_key_exists('ID', $parent)) != false) { $status = 202; } } } // Si la page d'actuelle n'existe pas, il ne faut plus continuer. //var_dump( $status ); //var_dump( $controller ); if ($status == 404) { return $status; } $thread[] = $status; // S'il y a des donnée à traiter, nous supposons qu'il y a des sous page, dans le cas contraire, on affiche la dernière page if (!isset($controller[$i + 1])) { if ($status == 202 && $thread[count($thread) - 1] == 202) { // Si la page actuelle page existe et le dernier parent return $this->get_pages('filter_id', $page[0]['ID']); } else { return 404; } } } } return false; }
/** * Return Declared API **/ function get_apis($namespace = null) { if ($namespace != null) { return return_if_array_key_exists($namespace, get_core_vars('api_declared')); } else { if ($namespace == null) { return get_core_vars('api_declared'); } } }
<?php $active_theme = get_core_vars('active_theme'); $theme_settings = return_if_array_key_exists('theme_settings', $active_theme); if ($theme_settings) { if (is_array(get_active_theme_vars('theme_items'))) { foreach (get_active_theme_vars('theme_items') as $namespace => $items) { // Si l'item à été enregistré dans les réglages du thèmes if (array_key_exists($namespace, $theme_settings)) { $item_settings = $theme_settings[$namespace]; $api = get_apis(return_if_array_key_exists('declared_apis', $item_settings)); $callback = return_if_array_key_exists('callback', $api); if ($callback) { if (is_array($callback)) { if (method_exists($callback[0], $callback[1])) { // We dont consider Item IF setting limit result to 0 if ((int) $item_settings['api_limit'] > 0) { $returned = $callback[0]->{$callback}[1]($item_settings['api_limit']); // Set Item With Returned datas from API if (is_array($returned)) { foreach ($returned as $r) { set_item($namespace, $r); } } } } } } // } }
public function list_services($array) { /** * OK **/ $title_lev = return_if_array_key_exists('title', $array); $titles = return_if_array_key_exists('level', $title_lev); $desc_lev = return_if_array_key_exists('description', $array); $description = return_if_array_key_exists('level', $desc_lev); $icon_lev = return_if_array_key_exists('icons', $array); $icons = return_if_array_key_exists('level', $icon_lev); $link_lev = return_if_array_key_exists('link', $array); $links = return_if_array_key_exists('level', $link_lev); ?> <section id="services" class="emerald"> <div class="container" style="padding:40px 0px"> <div class="row"> <?php if (count($titles) == count($description) && count($icons) == count($titles)) { for ($i = 0; $i < count($titles); $i++) { ?> <div class="col-md-4 col-sm-6"> <div class="media"> <div class="pull-left"> <i class="icon-<?php echo $icons[$i]; ?> icon-md"></i> </div> <div class="media-body"> <h3 class="media-heading"><a href="<?php echo return_if_array_key_exists($i, $links); ?> "><?php echo $titles[$i]; ?> </a></h3> <p><?php echo strip_tags($description[$i]); ?> </p> </div> </div> </div><!--/.col-md-4--> <?php } } ?> </div> </div> </section> <?php }
echo riake('value', $item); } } } } } } } } } } } else { echo $content; } $submit_text = return_if_array_key_exists('submit_text', $form_wrap); $reset_text = return_if_array_key_exists('reset_text', $form_wrap); if ($submit_text || $reset_text) { ?> <hr class="line line-dashed"> <div class="btn-group"> <?php if ($submit_text) { ?> <button type="submit" class="btn <?php echo theme_button_class(); ?> "><?php echo $submit_text; ?> </button> <?php
function loop_items($field, $namespace, $status, &$item_setting = array()) { // var_dump( $item_setting ); $title = return_if_array_key_exists('input_title', $field); $value = return_if_array_key_exists('input_value', $field); $name = return_if_array_key_exists('input_name', $field); $placeholder = return_if_array_key_exists('input_placeholder', $field); $closing_bracket = $status == 'is_loopable' ? '[]' : ''; $level_name = $status == 'is_loopable' ? '[level]' : ''; if (in_array($type = return_if_array_key_exists('input_type', $field), array('text', 'password', 'email', 'hidden'))) { // This Fields does not support array $value = is_array($value) ? '' : $value; if (!($value = return_if_array_key_exists($name, $item_setting))) { $value = ''; } /** Si la valeur enregistré est un tableau, l'on considère qu'il s'agit d'un élément loopable * $value = [ 'level' ][1][2][3][4] * Le moyen de parcourir ces éléments sans accéder à la boucle est de supprimer la première valeur du tableau. **/ if (is_array($value)) { array_shift($item_setting[$name]['level']); $value = $value['level'][0]; } ?> <div class="form-group"> <div class="input-group input-group-sm"> <span class="input-group-addon"><?php echo $title; ?> </span> <input type="<?php echo $type; ?> " class="form-control" placeholder="<?php echo $placeholder; ?> " value="<?php echo $value; ?> " name="static[<?php echo $namespace; ?> ][<?php echo $name; ?> ]<?php echo $level_name; echo $closing_bracket; ?> "> </div> </div> <?php } else { if ($type == 'textarea') { // This Fields does not support array $value = is_array($value) ? '' : $value; if (!($value = return_if_array_key_exists($name, $item_setting))) { $value = ''; } /** Si la valeur enregistré est un tableau, l'on considère qu'il s'agit d'un élément loopable * $value = [ 'level' ][1][2][3][4] * Le moyen de parcourir ces éléments sans accéder à la boucle est de supprimer la première valeur du tableau. **/ if (is_array($value)) { array_shift($item_setting[$name]['level']); $value = $value['level'][0]; } ?> <div class="form-group"> <label for="global-fields-textarea-<?php echo $title; ?> "><?php echo $title; ?> </label> <textarea name="static[<?php echo $namespace; ?> ][<?php echo $name; ?> ]<?php echo $level_name; echo $closing_bracket; ?> " class="form-control" id="global-fields-textarea-<?php echo $title; ?> " placeholder="<?php echo $placeholder; ?> "><?php echo $value; ?> </textarea> </div> <?php } else { if ($type == 'media_lib') { // This Fields does not support array $value = is_array($value) ? '' : $value; if (!($value = return_if_array_key_exists($name, $item_setting))) { $value = ''; } /** Si la valeur enregistré est un tableau, l'on considère qu'il s'agit d'un élément loopable * $value = [ 'level' ][1][2][3][4] * Le moyen de parcourir ces éléments sans accéder à la boucle est de supprimer la première valeur du tableau. **/ if (is_array($value)) { array_shift($item_setting[$name]['level']); $value = $value['level'][0]; } ?> <div class="form-group"> <label for="global-fields-textarea-<?php echo $title; ?> "><?php echo $title; ?> </label> <?php get_core_vars('fmlib')->mediaLib_button(array('PLACEHOLDER' => $placeholder, 'NAME' => 'static[' . $namespace . '][' . $name . ']' . $level_name . $closing_bracket, 'TEXT' => $title, 'VALUE' => $value)); ?> </div> <?php } else { if ($type == 'select') { // This Fields Support array $selected = ''; if (is_array($value)) { if ($field_setting = return_if_array_key_exists($name, $item_setting)) { if (is_array(riake('level', $item_setting[$name]))) { $selected = $item_setting[$name]['level'][0]; array_shift($item_setting[$name]['level']); } else { if (riake($name, $item_setting)) { $selected = $item_setting[$name]; } } } } $value = !is_array($value) ? array() : $value; ?> <div class="form-group"> <div class="input-group input-group-sm"> <span class="input-group-addon"><?php echo $title; ?> </span> <select class="form-control" placeholder="<?php echo $placeholder; ?> " name="static[<?php echo $namespace; ?> ][<?php echo $name; ?> ]<?php echo $level_name; echo $closing_bracket; ?> "> <option value=""><?php echo $placeholder !== false ? $placeholder : "Veuillez choisir une option"; ?> </option> <?php foreach ($value as $option) { if (return_if_array_key_exists('value', $option) == $selected) { ?> <option selected value="<?php echo return_if_array_key_exists('value', $option); ?> "><?php echo return_if_array_key_exists('text', $option); ?> </option> <?php } else { ?> <option value="<?php echo return_if_array_key_exists('value', $option); ?> "><?php echo return_if_array_key_exists('text', $option); ?> </option> <?php } } ?> </select> </div> </div> <?php } } } } }
function get_active_theme_vars($key = null) { $active_theme = get_core_vars('active_theme'); if ($key == null) { return $active_theme; } return return_if_array_key_exists($key, $active_theme); }
$AUTEUR_METAS = get_user_meta('all', $C['AUTEUR'], 'as_id'); $avatar = return_if_array_key_exists('avatar_link', $AUTEUR_METAS) ? return_if_array_key_exists('avatar_link', $AUTEUR_METAS) : img_url('avatar_default.jpg'); ?> <div class="panel-body"> <div class="clearfix m-b"> <small class="text-muted pull-right"><?php echo $timespan; ?> </small> <a href="#" class="thumb-sm pull-left m-r"> <img src="<?php echo $avatar; ?> " class="img-circle"> </a> <div class="clear"> <a href="#"><strong><?php echo $AUTEUR['PSEUDO']; ?> </strong></a> <small class="block text-muted"><?php echo return_if_array_key_exists('town', $AUTEUR_METAS) != '' && return_if_array_key_exists('state', $AUTEUR_METAS) != '' ? return_if_array_key_exists('town', $AUTEUR_METAS) . ', ' . return_if_array_key_exists('state', $AUTEUR_METAS) : __('Unknow'); ?> </small> </div> </div> <p><a href="<?php echo get_instance()->url->site_url(array('admin', 'open', 'modules', $MODULE['namespace'], 'comments_manage', $C['ID'])); ?> "><?php echo word_limiter($C['CONTENT'], 20); ?> </a></p> <small class=""> <span class="text-muted"><a href="<?php echo get_instance()->url->site_url(array('admin', 'open', 'modules', $MODULE['namespace'], 'edit', $ARTICLE[0]['ID'])); ?> "><i class="fa fa-share"></i> <?php echo $ARTICLE[0]['TITLE'];
?> <?php foreach (force_array($this->cols) as $key => $c) { ?> <?php if ($total_width - riake('width', $c, 4) * $col_range >= 0) { ?> <?php $total_width -= riake('width', $c, 4) * $col_range; ?> <div class="col-lg-<?php echo riake('width', $c, 4) * $col_range; ?> "> <?php $config = return_if_array_key_exists('configs', $this->cols[$key]); ?> <?php // Inner Opening Wrapper echo riake('inner-opening-wrapper', $config, ''); if (is_array($config)) { foreach ($config as $key => $_v) { if (is_array($_v)) { foreach ($_v as $_k => $panel) { // To add specfic wrapper before meta echo riake('opening-wrapper', $panel, ''); $type = riake('type', $panel, 'panel'); set_core_vars('panel', $panel); if ($type == "panel") { ?> <section class="box <?php
<td><a href="<?php echo module_url(array('edit', $_pages['ID'])); ?> "><?php echo return_if_array_key_exists('TITLE', $_pages); ?> <?php echo $_pages['STATUS'] == 0 ? '<span class="text-muted">' . __('[Draft]') . '</span>' : ''; ?> </a></td> <td><?php echo $author['PSEUDO']; ?> </td> <td><?php echo return_if_array_key_exists('PAGE_TITLE', $controller[0]) ? return_if_array_key_exists('PAGE_TITLE', $controller[0]) : __('No controller'); ?> </td> <td><?php echo $this->date->timespan($_pages['DATE']); ?> </td> <td><?php if (is_array($controller)) { ?> <a href="<?php echo get_instance()->url->site_url(array($controller[0]['PAGE_CNAME'])); ?> "> <?php _e('Open that page');