Beispiel #1
0
function items_order($category)
{
    global $website;
    global $DB;
    global $layout;
    $out = array();
    $layout = new layout('free');
    $naviforms = new naviforms();
    // order blocks of the same type (for lists with priority ordering)
    $DB->query('SELECT i.id as id, d.text as title
                  FROM nv_items i, nv_webdictionary d
                 WHERE i.association = "category"
                   AND i.category = "' . $category . '"
                   AND d.node_type = "item"
                   AND d.subtype = "title"
                   AND d.lang = "' . $website->languages_list[0] . '"
                   AND d.node_id = i.id
                   AND i.website = ' . $website->id . '
                   AND d.website = ' . $website->id . '
                ORDER BY i.position ASC');
    $item_ids = $DB->result('id');
    $items = $DB->result();
    $out[] = $naviforms->hidden('items-order', implode('#', $item_ids));
    $table = new naviorderedtable("items_order_table");
    $table->setWidth("560px");
    $table->setHiddenInput("items-order");
    $table->addHeaderColumn('ID', 50);
    $table->addHeaderColumn(t(67, 'Title'), 450);
    foreach ($items as $row) {
        $table->addRow($row->id, array(array('content' => $row->id, 'align' => 'left'), array('content' => $row->title, 'align' => 'left')));
    }
    $out[] = '<div class="subcomment" style=" margin-left: 0px; margin-bottom: 10px; "><img src="img/icons/silk/information.png" align="absmiddle" /> ' . t(72, 'Drag any row to assign priorities') . '</div>';
    $out[] = '<div>' . $table->generate() . '</div>';
    $out[] = '<div class="subcomment" style=" margin-left: 0px; margin-top: 10px; "><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 4px; "></span> ' . t(408, 'Order is only used on lists ordered by priority') . '</div>';
    $out[] = $layout->generate();
    return implode("\n", $out);
}
Beispiel #2
0
function block_group_extension_block_options($block_group, $block_extension, $block_id, $block_uid, $status)
{
    global $layout;
    global $website;
    global $theme;
    if (empty($block_extension)) {
        throw new Exception("Unknown extension: {" . $block_extension . "} for block with uid:" . $block_uid);
    }
    $extension = new extension();
    $extension->load($block_extension);
    $block = block::extension_block($extension, $block_id);
    $properties = $block->properties;
    if (empty($properties)) {
        return;
    }
    $layout = null;
    $layout = new layout('navigate');
    if ($status !== null) {
        if ($status) {
            $layout->navigate_notification(t(53, "Data saved successfully."), false, false, 'fa fa-check');
        } else {
            $layout->navigate_notification(t(56, "Unexpected error"), true, true);
        }
    }
    $navibars = new navibars();
    $naviforms = new naviforms();
    $navibars->title(t(437, 'Block') . ' [' . $block_extension . ' / ' . $block_id . ']');
    $layout->navigate_media_browser();
    // we can use media browser in this function
    $navibars->add_actions(array('<a href="#" onclick="javascript: navigate_media_browser();">
                <img height="16" align="absmiddle" width="16" src="img/icons/silk/images.png"> ' . t(36, 'Media') . '</a>'));
    $navibars->add_actions(array('<a href="#" onclick="navigate_tabform_submit(0);">
                <img height="16" align="absmiddle" width="16" src="img/icons/silk/accept.png"> ' . t(34, 'Save') . '</a>'));
    $navibars->form();
    $navibars->add_tab(t(200, 'Options'));
    $navibars->add_tab_content($naviforms->hidden('form-sent', 'true'));
    // show a language selector (only if it's a multi language website)
    if (count($website->languages) > 1) {
        $website_languages_selector = $website->languages();
        $website_languages_selector = array_merge(array('' => '(' . t(443, 'All') . ')'), $website_languages_selector);
        $navibars->add_tab_content_row(array('<label>' . t(63, 'Languages') . '</label>', $naviforms->buttonset('language_selector', $website_languages_selector, '', "navigate_tabform_language_selector(this);")));
    }
    $properties_values = property::load_properties(NULL, $block_id, "extension_block", $block_group, $block_uid);
    foreach ($properties as $option) {
        $property = new property();
        $property_value = '';
        foreach ($properties_values as $pv) {
            if ($pv->id == $option->id) {
                $property_value = $pv->value;
            }
        }
        $property->load_from_object($option, $property_value, $extension);
        if ($property->type == 'tab') {
            $navibars->add_tab($property->name);
            if (count($website->languages) > 1) {
                $website_languages_selector = $website->languages();
                $website_languages_selector = array_merge(array('' => '(' . t(443, 'All') . ')'), $website_languages_selector);
                $navibars->add_tab_content_row(array('<label>' . t(63, 'Languages') . '</label>', $naviforms->buttonset('language_selector', $website_languages_selector, '', "navigate_tabform_language_selector(this);")));
            }
        }
        $navibars->add_tab_content(navigate_property_layout_field($property, $extension));
    }
    $layout->add_content('<div id="navigate-content" class="navigate-content ui-corner-all">' . $navibars->generate() . '</div>');
    navigate_property_layout_scripts();
    $layout->navigate_additional_scripts();
    $layout->add_script('
        $("html").css("background", "transparent");
    ');
    $out = $layout->generate();
    return $out;
}
function extensions_dialog($extension, $function, $params)
{
    global $layout;
    $layout = null;
    $layout = new layout('navigate');
    // load the extension source code, if not already done
    extension::include_php($extension->code);
    if (function_exists($function)) {
        call_user_func($function, $params);
        $out = $layout->generate();
    } else {
        $out = 'ERROR: "' . $function . '" function does not exist!';
    }
    return $out;
}
Beispiel #4
0
$layout->add_content('<div class="navigate-top"></div>');
$layout->navigate_logo();
$layout->navigate_session();
$layout->navigate_title();
$menu_html = $menu_layout->generate_html();
// load website theme
if (!empty($website->theme)) {
    $theme = new theme();
    $theme->load($website->theme);
    if (!empty($website->theme) && empty($theme->title)) {
        $layout->navigate_notification(t(439, 'Error loading theme') . ' ' . $website->theme, true);
        debug_json_error($website->theme . ': JSON ERROR ');
    }
}
$layout->add_content('<div id="navigate-menu">' . $menu_html . '</div>');
$content = core_run();
$layout->navigate_footer();
$layout->add_content('<div id="navigate-content" class="navigate-content ui-corner-all">' . $content . '</div>');
$layout->navigate_additional_scripts();
// print layout
if (!isset($_GET['mute'])) {
    if (!APP_DEBUG && headers_sent()) {
        ob_start("ob_gzhandler");
    }
    echo $layout->generate();
    if (!APP_DEBUG) {
        ob_end_flush();
    }
}
session_write_close();
$DB->disconnect();