Example #1
0
/**
 * Handle page DOM within the page header
 *
 * @return string JS source
 */
function headerjs()
{
    //FIXME breaking functionality.
    return;
    require_once e_HANDLER . 'js_helper.php';
    $ret = "\n\t\t<script type='text/javascript' src='" . e_JS . "core/admin.js'></script>\n\t\t<script type='text/javascript'>\n\t\t\t//add required core lan - delete confirm message\n\t\t\t(" . e_jshelper::toString(LAN_JSCONFIRM) . ").addModLan('core', 'delete_confirm');\n\n\t\t\t//core object\n\t\t\te107Admin.CoreLanguage = {};\n\t\t\t//show Table Copy option\n\t\t\te107Admin.CoreLanguage.dataCopy = function(table) {\n\t\t\t\tif(\$('language-datacopy-' + table)) {\n\t\t\t\t\t\$('language-datacopy-' + table).show();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//registry - selected by default\n\t\t\te107Admin.CoreLanguage._def_checked = {}\n\n\t\t\t//document observer\n\t\t\tdocument.observe('dom:loaded', function() {\n\t\t\t\t//find lan action checkboxes\n\t\t\t\t\$\$('input[type=checkbox][id^=language-action-]').each( function(element) {\n\t\t\t\t\tif(element.checked) e107Admin.CoreLanguage._def_checked[element.id] = true;// already checked, don't allow data copy\n\t\t\t\t\tvar carea = element.up('div.auto-toggle-area');\n\n\t\t\t\t\t//clickable container - autocheck + allow data copy\n\t\t\t\t\tif(carea) {\n\t\t\t\t\t\tcarea.observe('click', function(e) {\n\t\t\t\t\t\t\telement.checked = !(element.checked);\n\t\t\t\t\t\t\tif(element.checked && !e107Admin.CoreLanguage._def_checked[element.id]) {\n\t\t\t\t\t\t\t\te107Admin.CoreLanguage.dataCopy(element.id.replace(/language-action-/, ''));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t//checkbox observer\n\t\t\t\t\telement.observe('click', function(e) {\n\t\t\t\t\t\tif(e.element().checked && !e107Admin.CoreLanguage._def_checked[element.id])\n\t\t\t\t\t\t\te107Admin.CoreLanguage.dataCopy(e.element().id.replace(/language-action-/, ''));\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t";
    return $ret;
}
Example #2
0
// XXX DEPRECATED $body_onload and related functionality
if (defined('THEME_ONLOAD')) {
    $js_body_onload[] = THEME_ONLOAD;
}
$body_onload = '';
if (count($js_body_onload)) {
    $body_onload = " onload=\"" . implode(" ", $js_body_onload) . "\"";
}
//
// J: Send end of <head> and start of <body>
//
/*
 * Admin LAN
 * TODO - remove it from here
 */
e107::js('inline', "\n\t(" . e_jshelper::toString(LAN_JSCONFIRM) . ").addModLan('core', 'delete_confirm');\n\t(" . e_jshelper::toString(LAN_DELETE) . ").addModLan('core', 'delete');\n\n", 'prototype', 5);
// [JSManager] Load JS Includes - Zone 5 - After theme_head, before e107:loaded trigger
// unobtrusive JS - moved here from external e_css.php
e107::getJs()->renderJs('header', 5);
/*
 * Fire Event e107:loaded - Prototype only
 */
//\$('e-js-css').remove();
/*
e107::js('inline',"
document.observe('dom:loaded', function () {
e107Event.trigger('loaded', null, document);
});
",'prototype',5);
*/
e107::getJs()->renderJs('header_inline', 5);
Example #3
0
File: auth.php Project: notzen/e107
            require_once e_ADMIN . "header.php";
        } else {
            // boot.php is included in admin dispatcher constructor, so do it only for legacy code
            require_once e_ADMIN . 'boot.php';
        }
    }
    /*
     * FIXME - missing $style for tablerender
     * The Solution: parse_admin() without sending it to the browser if it's an ajax call
     * The Problem: doubled render time for the ajax called page!!!
     */
} else {
    //login via AJAX call is not allowed
    if (e_AJAX_REQUEST) {
        require_once e_HANDLER . 'js_helper.php';
        e_jshelper::sendAjaxError(403, ADLAN_86, ADLAN_87, true);
    }
    require_once e_ADMIN . 'boot.php';
    $sec_img = e107::getSecureImg();
    $use_imagecode = $pref['logcode'] && extension_loaded("gd");
    if ($_POST['authsubmit']) {
        $obj = new auth();
        if ($use_imagecode) {
            if ($sec_img->invalidCode($_POST['rand_num'], $_POST['code_verify'])) {
                e107::getRedirect()->redirect('admin.php?failed');
                exit;
                //	echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
                //	header("location: ../index.php");
                //	exit;
            }
        }
Example #4
0
/**
 * Handle page DOM within the page header
 *
 * @return string JS source
 */
function headerjs()
{
    require_once e_HANDLER . 'js_helper.php';
    $ret = "\n\t\t<script type='text/javascript'>\n\t\t\t//add required core lan - delete confirm message\n\t\t\t(" . e_jshelper::toString(LAN_JSCONFIRM) . ").addModLan('core', 'delete_confirm');\n\t\t\tif(typeof e107Admin == 'undefined') var e107Admin = {}\n\n\t\t\t/**\n\t\t\t * OnLoad Init Control\n\t\t\t */\n\t\t\te107Admin.initRules = {\n\t\t\t\t'Helper': true,\n\t\t\t\t'AdminMenu': false\n\t\t\t}\n\t\t</script>\n\t\t<script type='text/javascript' src='" . e_JS . "core/admin.js'></script>\n\t";
    return $ret;
}
Example #5
0
 function ajax_exec_cat()
 {
     if (!getperms('0|7')) {
         exit;
     }
     //require_once (e_HANDLER.'js_helper.php');
     $e107 = e107::getInstance();
     $category = array();
     if ($e107->sql->db_Select("news_category", "*", "category_id=" . $this->getId())) {
         $category = $e107->sql->db_Fetch();
     }
     if (empty($category)) {
         e_jshelper::sendAjaxError(404, 'Page not found!', 'Requested news category was not found in the DB.', true);
     }
     $jshelper = new e_jshelper();
     $jshelper->addResponseAction('fill-form', $category);
     //show cancel and update, hide create buttons; disable create button (just in case)
     $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'category-clear,update-category', 'disabled,1' => 'create-category', 'hide' => 'create-category', 'newsScrollToMe' => 'core-newspost-cat-create'));
     //Send the prefered response type
     $jshelper->sendResponse('XML');
 }
Example #6
0
/**
 * Handle page DOM within the page header
 *
 * @return string JS source
 */
function headerjs()
{
    require_once e_HANDLER . 'js_helper.php';
    $ret = "\r\n\t\t<script type='text/javascript'>\r\n\t\t\t//add required core lan - delete confirm message\r\n\t\t\t(" . e_jshelper::toString(LAN_JSCONFIRM) . ").addModLan('core', 'delete_confirm');\r\n\t\t</script>\r\n\t\t\r\n\t";
    return $ret;
}
Example #7
0
/**
 * Handle page DOM within the page header
 *
 * @return string JS source
 */
function headerjs()
{
    require_once e_HANDLER . 'js_helper.php';
    $ret = "\n\t\t<script type='text/javascript'>\n\t\t\t//add required core lan - delete confirm message\n\t\t\t(" . e_jshelper::toString(FRTLAN_54) . ").addModLan('core', 'delete_confirm');\n\t\t</script>\n\t\t<script type='text/javascript' src='" . e_JS . "core/admin.js'></script>\n\t";
    return $ret;
}
Example #8
0
    // BC - SO MUCH BAD, never do this at home!!!
    if (isset($_GET['action'])) {
        $uc_qs = array($_GET['action'], $_GET['id']);
    } else {
        $uc_qs = explode(".", e_QUERY);
    }
}
$action = varset($uc_qs[0]);
$params = varset($uc_qs[1], '');
e107::setRegistry('pageParams', $uc_qs);
//AJAX request check is already  made by the API
if (e_AJAX_REQUEST) {
    $class_num = intval($params);
    if ($action == 'edit') {
        require_once e_HANDLER . 'js_helper.php';
        $jshelper = new e_jshelper();
        if (!check_allowed($class_num, false)) {
            //This will raise an error
            //'Access denied' is the message which will be thrown
            //by the JS AJAX handler
            e_jshelper::sendAjaxError('403', 'Access denied. ' . UCSLAN_90);
        } elseif ($sql->db_Select('userclass_classes', '*', "userclass_id='" . $class_num . "' ")) {
            $row = $sql->db_Fetch(MYSQL_ASSOC);
            //Response action - reset all group checkboxes
            $jshelper->addResponseAction('reset-checked', array('group_classes_select' => '0'));
            //it's grouped userclass
            if ($row['userclass_type'] == UC_TYPE_GROUP) {
                //Response action - show group, hide standard
                $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'userclass_type_groups', 'hide' => 'userclass_type_standard'));
                //fill in the classes array
                $tmp = explode(',', $row['userclass_accum']);