示例#1
0
<?php

if (class_exists($Class . '_frontend')) {
    /**
     * @since 1.4
     * Launch bound events to "before_frontend" hook.
     **/
    trigger_events('before_frontend');
    // Ce module utilisent l'obect get_core_vars( 'active_theme_object' ); et génèrent une vue.
    if ($this->tendoo->interpreter($Class . '_frontend', $Method, $Parameters, array(), get_core_vars('module')) === '404') {
        $this->tendoo->error('page-404');
    }
} else {
    if (class_exists('Tendoo_' . $Class)) {
        if ($this->tendoo->interpreter('Tendoo_' . $Class, $Method, $Parameters) === '404') {
            $theme = get_core_vars('active_theme_object');
            // Added - Tendoo 0.9.2
            // GLOBAL MODULES
            $this->tendoo->error('page-404');
        }
    } else {
        if (class_exists($Class)) {
            if ($this->tendoo->interpreter($Class, $Method, $Parameters) === '404') {
                $this->tendoo->error('page-404');
            }
        } else {
            $this->tendoo->error('page-404-or-module-bug');
        }
    }
}
示例#2
0
}
trigger_events('after_title_inition', array($current_posttype, $this->gui, $post_namespace . '-create-new', $post));
// Trigger each event bound
trigger_events('before_editor_inition', array($current_posttype, $this->gui, $post_namespace . '-create-new', $post));
// Trigger each event bound
if (in_array('editor', riake('displays', $current_posttype->get_config()))) {
    $this->gui->set_item(array('type' => 'visual_editor', 'name' => 'post_content', 'value' => riake('CONTENT', $post)))->push_to($post_namespace . '-edit-new');
}
trigger_events('after_editor_inition', array($current_posttype, $this->gui, $post_namespace . '-create-new', $post));
// Trigger each event bound
trigger_events('before_publish_inition', array($current_posttype, $this->gui, $post_namespace . '-create-new-sidebar', $post));
// Trigger each event bound
if (in_array('publish', riake('displays', $current_posttype->get_config()))) {
    if ($defined_taxonomies = $current_posttype->query->get_defined_taxonomies()) {
        foreach (force_array($defined_taxonomies) as $tax_namespace => $_taxonomy) {
            //current_posttype
            $taxonomy_text = $taxonomy_value = array();
            $taxonomies_list = $current_posttype->query->get_taxonomies($tax_namespace);
            foreach (force_array($taxonomies_list) as $_taxonomy) {
                $taxonomy_text[] = riake('TITLE', $_taxonomy);
                $taxonomy_value[] = riake('ID', $_taxonomy);
            }
            $this->gui->set_item(array('type' => 'multiple', 'name' => 'post_taxonomy[' . $tax_namespace . '][]', 'text' => $taxonomy_text, 'value' => $taxonomy_value, 'label' => __('Select a taxonomy'), 'active' => riake('TAXONOMIES', $post)))->push_to($post_namespace . '-edit-new-sidebar');
        }
    }
    $this->gui->set_item(array('type' => 'select', 'name' => 'post_status', 'text' => array(__('Draft'), __('Publish')), 'value' => array(0, 1), 'label' => __('Status'), 'active' => riake('STATUS', $post)))->push_to($post_namespace . '-edit-new-sidebar');
}
trigger_events('after_publish_inition', array($current_posttype, $this->gui, $post_namespace . '-create-new-sidebar', $post));
// Trigger each event bound
$this->gui->set_item(array('type' => 'buttons', 'name' => array('submit_content'), 'value' => array(__('Submit')), 'buttons_types' => array('submit')))->push_to($post_namespace . '-edit-new-sidebar');
$this->gui->get();
示例#3
0
/**
 *	get_item( 'namespace' , 'associated_items' );
 *	events : set_items_vars
 **/
function get_items($namespace)
{
    $saved_items = get_active_theme_vars('theme_items');
    $style = return_if_array_key_exists($namespace, $saved_items);
    if ($style) {
        $has_loop = return_if_array_key_exists('has_loop', $style);
        $before_loop = return_if_array_key_exists('before_loop', $style);
        $after_loop = return_if_array_key_exists('after_loop', $style);
        $the_loop_item = return_if_array_key_exists('the_loop_item', $style);
        $is_static = return_if_array_key_exists('item_loopable_fields', $style) || return_if_array_key_exists('item_global_fields', $style);
        // Si l'élément est statique
        if ($is_static) {
            // $datas		=	$style;
            $th_setting = get_active_theme_vars('theme_settings');
            $datas = return_if_array_key_exists($namespace, $th_setting);
        } else {
            // Recupération depuis l'API
            $global_data = get_active_theme_vars("items_datas");
            // Recupérations depuis les données renvoyés
            $datas = return_if_array_key_exists($namespace, $global_data);
        }
        if (is_array($datas)) {
            if (has_events('handle_' . $namespace)) {
                return trigger_events('handle_' . $namespace, $datas);
            } else {
                echo $before_loop;
                if ($has_loop === true) {
                    // Looping Defined Vars and set them as variables
                    foreach ($datas as $value) {
                        if (is_array($value)) {
                            foreach ($value as $key => $value) {
                                // les key sont celles sur le tableau renvoyé par l'API
                                ${$key} = $value;
                                // If there are events declared
                                if (has_events('set_' . $namespace . '_items_vars')) {
                                    ${$key} = trigger_events('set_' . $namespace . '_items_vars', array($key, $value));
                                    // if triggered events return null, we don't consider events
                                    if (${$key} == null) {
                                        ${$key} = $value;
                                    }
                                }
                            }
                        }
                        // Looping the_loop_item as set on declare_items
                        if (is_array($the_loop_item)) {
                            foreach ($the_loop_item as $lines) {
                                if (has_events('loop_' . $namespace . '_lines')) {
                                    $result = trigger_events('loop_' . $namespace . '_lines', array($lines));
                                    $lines = $result == null ? $lines : $result;
                                }
                                if (substr($lines, 0, 1) == "[" && substr($lines, -1) == "]") {
                                    $var = substr($lines, 1, -1);
                                    echo isset(${$var}) ? ${$var} : $lines;
                                } else {
                                    echo $lines;
                                }
                            }
                        }
                    }
                }
                echo $after_loop;
            }
        }
    }
}