echo $ccms['lang']['editor']['cancelbtn'];
    ?>
"><span class="ss_sprite_16 ss_cross">&#160;</span><?php 
    echo $ccms['lang']['editor']['cancelbtn'];
    ?>
</a>
				</div>
			<?php 
}
?>
			</form>
		</div>
	</div>
<?php 
if (0) {
    dump_request_to_logfile(array('btn_backup' => $btn_backup, 'do' => $do, 'btn_delete' => $btn_delete), true);
}
?>


<?php 
if ($cfg['IN_DEVELOPMENT_ENVIRONMENT']) {
    ?>
	<textarea id="jslog" class="log span-25" readonly="readonly">
	</textarea>
<?php 
}
?>


<script type="text/javascript" charset="utf-8">
Beispiel #2
0
> Contact me for any inquiries.
> E: Xander@CompactCMS.nl
> W: http://community.CompactCMS.nl/forum
************************************************************ */
/* make sure no-one can run anything here if they didn't arrive through 'proper channels' */
if (!defined("COMPACTCMS_CODE")) {
    define("COMPACTCMS_CODE", 1);
}
/*MARKER*/
if (!defined('BASE_PATH')) {
    $base = str_replace('\\', '/', dirname(__FILE__));
    define('BASE_PATH', $base);
}
// This file loads the appropriate configuration
/*MARKER*/
require_once BASE_PATH . '/lib/sitemap.php';
// This file parses the template and coding
/*MARKER*/
require_once BASE_PATH . '/lib/class/engine.class.php';
// Set friendly menu names
$ccms['mainmenu'] = isset($ccms['structure1']) ? $ccms['structure1'] : null;
$ccms['leftmenu'] = isset($ccms['structure2']) ? $ccms['structure2'] : null;
$ccms['rightmenu'] = isset($ccms['structure3']) ? $ccms['structure3'] : null;
$ccms['footermenu'] = isset($ccms['structure4']) ? $ccms['structure4'] : null;
$ccms['extramenu'] = isset($ccms['structure5']) ? $ccms['structure5'] : null;
// Initialize ccmsParser class
ccmsParser::setTemplateAndEchoPHP(BASE_PATH . '/lib/templates/' . $ccms['template'] . '.tpl.html', $ccms, '<?php global $ccms, $cfg, $db, $modules, $v; ?>');
if ($cfg['IN_DEVELOPMENT_ENVIRONMENT']) {
    dump_request_to_logfile(null, true, true, true);
}
function FM_vardumper($mgr = null, $action = null, $info = null, $extra = null, $dump_options = __MTFM_VARDUMP_DEFAULT_OPTIONS)
{
    if (DEVELOPMENT) {
        if ($mgr) {
            $settings = $mgr->getSettings();
        } else {
            $settings = null;
        }
        //$mimetdefs = $mgr->getMimeTypeDefinitions();
        // log request data:
        $data = array("FileManager::action" => $action, "FileManager::info" => $info, "FileManager::settings" => $settings);
        if (!empty($extra)) {
            $data['extra'] = $extra;
        }
        dump_request_to_logfile($data, $dump_options, array('origin-section' => basename($_SERVER['REQUEST_URI']) . '-' . $action));
    }
}
Beispiel #4
0
 * we would have liked to calculate the version 'float' value from the ["MajorVer"] and ["MinorVer"] entries,
 * but then we'd be screwed when you got versions like '3.01' which would be encoded as 3 and 1.
 *
 * On the other hand we cannot assume the ["Version"] entry has just a single point. After all, there's nothing
 * stopping the format from speccing for example '3.01.2750' and again we'ld be screwed if we casted such an
 * entry to float without watching out. So we do it the hard way and pick ["Version"] and strip off anything
 * past the second '.' dot in there.
 */
if (!preg_match('/^([0-9]+(\\.[0-9]+)?)/', $client_browser->Version, $vmp)) {
    // illegal format: report this and fail dramatically
    send_response_status_header(500);
    die("Unexpected version format in browser capabilities DB: " . $client_browser->Version);
}
$client_browser->SniffedVersion = floatval($vmp[1]);
if (0) {
    dump_request_to_logfile(array('client_browser' => $client_browser, 'OPTIMIZE' => $optimize), false);
}
/*
 * we abuse the browscap conditional filter to check whether we should okay or discard this load request.
 *
 * This is our server-side alternative, suitable for use with lazyloading, to the MSIE conditional
 * comment.
 */
if (!empty($only_when_expression)) {
    $do_not_load = interpret_conditional_filter_expr($only_when_expression, $client_browser) == 0;
} else {
    $do_not_load = false;
}
/*
 * when $do_not_load==true then we produce a seemingly EMPTY file.
 *
Beispiel #5
0
<?php

// Define default location
if (!defined('BASE_PATH')) {
    die('BASE_PATH not defined!');
}
send_response_status_header(403);
echo '<p>' . $ccms['lang']['system']['error_403content'] . '</p>';
if (0) {
    dump_request_to_logfile(array('invocation_mode' => get_interpreter_invocation_mode(), 'response(404)' => get_response_code_string(404), 'response(403)' => get_response_code_string(403), 'response(302)' => get_response_code_string(302)), true);
}
                    if (!empty($value)) {
                        $orig_content .= "\n" . $key . ' = ' . $value;
                    }
                }
                @mkdir(BASE_PATH . '/media/files/lang-babel');
                file_put_contents(BASE_PATH . '/media/files/lang-babel/' . $to_lang . '.inc.php', "<?php\n" . $orig_content . "\n?>");
                $status_message = "The augmented translation data has been written to the file " . BASE_PATH . '/lib/languages/' . 'en' . '.inc.php';
                $status = 'notice';
                $error = false;
            }
        }
    }
    if ($error) {
        echo "boom!";
        if (0) {
            dump_request_to_logfile();
        }
        die;
    }
}
$load_editor = false;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Translation module</title>
	<link rel="stylesheet" type="text/css" href="../../../../admin/img/styles/base.css,liquid.css,layout.css,sprite.css,last_minute_fixes.css" />
</head>
<body>
Beispiel #7
0
    return strval($_POST[$var]);
}
function SESSION2str($var, $def = '')
{
    // prevent PHP barfing a hairball in E_STRICT:
    if (!isset($_SESSION) || empty($_SESSION[$var])) {
        return $def;
    }
    return strval($_SESSION[$var]);
}
// Check whether this is a send request
$action_type = getGETparam4IdOrNumber('do');
// debugging:
if ($cfg['IN_DEVELOPMENT_ENVIRONMENT'] && 0) {
    $extra = array('action_type' => $action_type, 'req_method_is_post' => $_SERVER['REQUEST_METHOD'] == 'POST', 'captcha-on' => USE_CAPTCHA_AGAINST_SPAM, 'captcha-match-a' => POST2str('verification', 'x'), 'captcha-match-b' => SESSION2str('ccms_captcha', 'y'), 'captcha-match' => POST2str('verification', 'x') == SESSION2str('ccms_captcha', 'y'), 'honeypot-on' => USE_HONEYTRAP_AGAINST_SPAM, 'honeypot-check1' => POST2str('email', '') == '', 'honeypot-check2-a' => POST2str('darling_jar', 'x'), 'honeypot-check2-b' => SESSION2str('ccms_contactform_honeypot', 'y'), 'honeypot-check2' => POST2str('darling_jar', 'x') == SESSION2str('ccms_contactform_honeypot', 'y'));
    dump_request_to_logfile($extra);
}
$error = null;
$success = null;
$is_form_post = false;
/*
Fetch values early, so we can keep their content on error: message is not 
immediately lost to user on faulty submit.

Security notes:

Considering the fact that we keep POST-ed data around when the POST itself is deemed
invalid, this user-friendly approach introduces a security hole if we're not careful.

Scenario:
Beispiel #8
0
             // loop so we use the second round to fetch the error page itself.
         }
     }
     // end of 2-round loop
     if ($content === false || $rcode !== false) {
         // failure occurred! produce a 'response code page' after all!
         if (!$rcode) {
             $rcode = 404;
         }
         setup_ccms_for_40x_error($rcode, $pagereq);
     }
     if (is_http_response_code($ccms['responsecode'])) {
         send_response_status_header($ccms['responsecode']);
     }
     if ($cfg['IN_DEVELOPMENT_ENVIRONMENT']) {
         dump_request_to_logfile(array('invocation_mode' => get_interpreter_invocation_mode()), true, true, true);
     }
 } else {
     /*
      * OPERATION MODE ==
      *
      * 3) Start dynamic sitemap creation used by spiders and various webmaster tools.
      *
      * e.g. You can use this function to submit a dynamic sitemap to Google Webmaster Tools.
      */
     $dir = $cfg['rootdir'];
     // [i_a] the original substr($_SERVER[]) var would fail when called with this req URL: index.php?page=sitemap
     /*
      Start generating sitemap
     
      See also: http://hsivonen.iki.fi/producing-xml/
Beispiel #9
0
 public function __construct($textarea_ids, $usr_options = null, $js_load_callback = 'jsComplete')
 {
     global $cfg;
     $this->rootdir = $cfg['rootdir'];
     $this->MCE_language = $cfg['tinymce_language'];
     $this->FM_language = $cfg['MT_FileManager_language'];
     $this->js_load_callback = $js_load_callback;
     // split the ID set and create a full MCE options array for each of 'em, keeping track of generic and specific user options
     $editarea_tags = explode(',', $textarea_ids);
     $options = array();
     $generic_user_opts = isset($usr_options[0]) && is_array($usr_options[0]) ? $usr_options[0] : array();
     foreach ($editarea_tags as $tag) {
         $user_opts = isset($usr_options[$tag]) && is_array($usr_options[$tag]) ? $usr_options[$tag] : array();
         $options[$tag] = array_merge(array('theme' => 'advanced'), $generic_user_opts, $user_opts);
         // do this defaulting in two steps: some of the item names are dependent on the actual theme picked for this tinyMCE instance:
         $theme = $options[$tag]['theme'];
         if ($cfg['iframe']) {
             $iframe_def_options = array('extended_valid_elements' => 'iframe[align<bottom?left?middle?right?top|class|frameborder|height|id|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style|title|width]');
         } else {
             $iframe_def_options = array();
         }
         $options[$tag] = array_merge(array('skin' => 'o2k7', 'skin_variant' => 'silver', 'mode' => 'exact', 'elements' => $tag, 'language' => $this->MCE_language, 'dialog_type' => 'modal', 'paste_auto_cleanup_on_paste' => true, 'autoresize_on_init' => true, 'autosave_ask_before_unload' => false, 'relative_urls' => false, 'convert_urls' => true, 'remove_script_host' => true, 'document_base_url' => $this->rootdir, 'content_css' => $this->rootdir . 'admin/img/styles/base.css,' . $this->rootdir . 'admin/img/styles/liquid.css,' . $this->rootdir . 'admin/img/styles/layout.css' . ',' . $this->rootdir . 'admin/img/styles/sprite.css,' . $this->rootdir . 'admin/img/styles/last_minute_fixes.css' . ',' . $this->rootdir . 'admin/img/styles/ie.css?only-when=%3d%3d+IE', 'spellchecker_languages' => '+English=en,Dutch=nl,German=de,Spanish=es,French=fr,Italian=it,Russian=ru', "theme_{$theme}_toolbar_location" => 'top', "theme_{$theme}_toolbar_align" => 'left', "theme_{$theme}_statusbar_location" => 'bottom', "theme_{$theme}_resizing" => true, "theme_{$theme}_resizing_use_cookie" => 1, "theme_{$theme}_resize_horizontal" => true, "theme_{$theme}_resizing_min_width" => 362, "theme_{$theme}_resizing_min_height" => 100, "theme_{$theme}_resizing_max_width" => null, "theme_{$theme}_resizing_max_height" => 0xffff), $iframe_def_options, $options[$tag]);
         // make sure, when the FileManager is required, that it's options are set up as well:
         if (isset($options[$tag]['FileManager'])) {
             $session_id = session_id();
             if (!empty($session_id)) {
                 $sid_def_options = array('uploadAuthData' => array('session' => $session_id));
             } else {
                 $sid_def_options = array();
             }
             $fm_user_opts = is_array($options[$tag]['FileManager']) ? $options[$tag]['FileManager'] : array();
             $options[$tag]['FileManager'] = array_merge(array('url' => $this->rootdir . 'lib/includes/js/mootools-filemanager/ccms/manager.php', 'baseURL' => $this->rootdir, 'assetBasePath' => $this->rootdir . 'lib/includes/js/mootools-filemanager/Assets', 'language' => $this->FM_language, 'selectable' => true, 'destroy' => true, 'upload' => true, 'rename' => true, 'download' => true, 'createFolders' => true, 'hideClose' => false, 'hideOverlay' => false, 'uploadAuthData' => array(), 'propagateData' => array('editor_req_type' => null)), $sid_def_options, $fm_user_opts);
         } else {
             unset($options[$tag]['FileManager']);
         }
         $pluginarr = get_tinyMCE_plugin_list(!empty($options[$tag]['plugins']) ? $options[$tag]['plugins'] : null);
         $plugs = array_keys($pluginarr);
         $plugs = array_filter($plugs, 'is_real_tinyMCE_plugin');
         $options[$tag]['plugins'] = implode(',', $plugs);
         dump_request_to_logfile(array('pluginarr' => $pluginarr));
         /*
         now create a list of buttons:
         
         we've moved the construction of the toolbars to the backend as we've found that using many small toolbars helps when the editor is resizing:
         wider (larger) toolbars block the editor from shrinking.
         
         The 'grouping' setting instructs us which tools should sit on the same toolbar.
         */
         $btngrp = array();
         $btnset = array();
         foreach ($pluginarr as $name => $info) {
             $bs = $info['buttons'];
             if (empty($bs)) {
                 continue;
             }
             $grp = $info['grouping'];
             $bsa = explode(',', $bs);
             foreach ($bsa as $btn1) {
                 $bdef = explode(':', $btn1);
                 if (count($bdef) > 1) {
                     // a button which is wider than the usual ones: length is specced as number of 'regular' buttons eqv.:
                     $bdef[1] = intval($bdef[1]);
                 } else {
                     $bdef[1] = $bdef[0] == '|' ? 10 : 22;
                     /* [px] width per button */
                 }
                 if (!isset($btngrp[$grp])) {
                     $btngrp[$grp] = array();
                 }
                 // also check whether button isn't already in the group/toolbar-set: some adv(anced) plugins override existing buttons/functions:
                 $xsist = array_key_exists($bdef[0], $btnset);
                 if (!$xsist) {
                     $btngrp[$grp][] = $bdef;
                     $btnset[$bdef[0]] = true;
                 }
             }
         }
         ksort($btngrp);
         dump_request_to_logfile(array('pluginarr' => $pluginarr, 'btngrp' => $btngrp));
         // bigger toolbar chunks are bad because you are limiting the shrinking capability of the editor window...
         $tbdef = $this->generateToolbarLayout($btngrp, 100);
         dump_request_to_logfile(array('pluginarr' => $pluginarr, 'btngrp' => $btngrp, 'tbdef' => $tbdef));
         for ($i = count($tbdef); $i > 0; $i--) {
             $options[$tag]["theme_{$theme}_buttons" . $i] = $tbdef[$i - 1];
         }
         // and make sure we blow away any inadvertedly user defined toolbars:
         for ($i = count($tbdef) + 1; isset($options[$tag]["theme_{$theme}_buttons" . $i]); $i++) {
             unset($options[$tag]["theme_{$theme}_buttons" . $i]);
         }
     }
     $this->options = $options;
 }