예제 #1
0
파일: setup.php 프로젝트: WuChEn/PHP-Fusion
    } elseif ($rows == 0) {
        echo "<br />\n" . $locale['077'] . "<br /><br />\n" . $error;
        echo "</td>\n</tr>\n<tr>\n<td class='tbl2' style='text-align:center'>\n";
        echo "<input type='hidden' name='localeset' value='" . stripinput($_POST['localeset']) . "' />\n";
        echo "<input type='hidden' name='error_pass' value='" . $error_pass . "' />\n";
        echo "<input type='hidden' name='error_name' value='" . $error_name . "' />\n";
        echo "<input type='hidden' name='error_mail' value='" . $error_mail . "' />\n";
        echo "<input type='hidden' name='username' value='" . $username . "' />\n";
        echo "<input type='hidden' name='email' value='" . $email . "' />\n";
        echo "<input type='hidden' name='step' value='5' />\n";
        echo "<button type='submit' name='back' value=" . $locale['008'] . "' class='btn btn-md btn-warning'><i class='entypo cw'></i> " . $locale['008'] . "</button>\n";
    } else {
        echo "<p><strong><br />\n" . $locale['240'] . "</strong></p>\n";
        echo "<input type='hidden' name='localeset' value='" . stripinput($_POST['localeset']) . "' />\n";
        echo "<input type='hidden' name='step' value='7' />\n";
        renderButton(1);
        // 009
    }
}
closesetup();
// Calculate script start/end time
function get_microtime()
{
    list($usec, $sec) = explode(" ", microtime());
    return (double) $usec + (double) $sec;
}
// Strip Input Function, prevents HTML in unwanted places
function stripinput($text)
{
    if (ini_get('magic_quotes_gpc')) {
        $text = stripslashes($text);
예제 #2
0
$buttons = array('details', 'enter', 'view', 'invite');
?>

<table border="0" cellspacing="1" cellpadding="0" style="margin-top: <?php 
echo $config['app']['bar-top'];
?>
; margin-right: <?php 
echo $config['app']['bar-right'];
?>
;">
<tr>
   <td width="260px"></td>
   <?php 
foreach ($buttons as $button) {
    $html = '<td>';
    $html .= renderButton($button, $_GET['tab']);
    $html .= '</td>';
    echo $html;
}
?>
</tr>
</table>


<div style="width: 740px; border-left: 10px solid <?php 
echo $config['app']['borderColor'];
?>
;  border-right: 10px solid <?php 
echo $config['app']['borderColor'];
?>
;  border-bottom: 10px solid <?php 
예제 #3
0
        break;
        // Step 7 - Final Settings
    // Step 7 - Final Settings
    case STEP_SETUP_COMPLETE:
        $content .= "<div class='m-b-20'><h4>" . $locale['setup_1600'] . "</h4> " . $locale['setup_1601'] . "</div>\n";
        $content .= "<div class='m-b-10'>" . $locale['setup_1602'] . "</div>\n";
        $content .= "<div class='m-b-10'>" . $locale['setup_1603'] . "</div>\n";
        $nextStep = STEP_EXIT;
        $buttonMode = 'finish';
        break;
    case STEP_EXIT:
        if (file_exists(BASEDIR . 'config_temp.php')) {
            @rename(BASEDIR . 'config_temp.php', BASEDIR . 'config.php');
            @chmod(BASEDIR . 'config.php', 0644);
        }
        unset($_SESSION['step']);
        redirect(BASEDIR . 'index.php');
        break;
}
$localeset = filter_input(INPUT_POST, 'localeset');
ob_start();
opensetup();
echo $content;
if ($localeset) {
    echo "<input type='hidden' name='localeset' value='" . stripinput($localeset) . "' />\n";
}
if ($buttonMode) {
    echo '<input type="hidden" name="step" value="' . $nextStep . '" />';
    renderButton($buttons[$buttonMode][0], $buttons[$buttonMode][1], $buttonMode);
}
closesetup();
예제 #4
0
/**
* TinyMCE WYSIWYG Editor - javascript initialization
*/
function botmostlyceEditorInit()
{
    global $mosConfig_live_site, $my, $database, $mosConfig_absolute_path, $jspath, $adminside, $mosConfig_secret;
    include $mosConfig_absolute_path . "/mambots/editors/mostlyce/jscripts/tiny_mce/mostlyce_config.php";
    //Allows for dynamic editor sizing by apps like Remository
    $get_width = mosGetParam($_GET, 'width', NULL);
    $get_height = mosGetParam($_GET, 'height', NULL);
    if ($get_width) {
        $editor_width = (int) $get_width;
    }
    if ($get_height) {
        $editor_height = (int) $get_height;
    }
    // Get the default stylesheet
    $query = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'";
    $database->setQuery($query);
    $cur_template = $database->loadResult();
    // Assigned template
    if (isset($Itemid) && $Itemid != "" && $Itemid != 0) {
        $query = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='{$Itemid}' LIMIT 1";
        $database->setQuery($query);
        $cur_template = $database->loadResult() ? $database->loadResult() : $cur_template;
    }
    //Plugin settings and Authorization
    $invalid_elements[] = 'object,applet';
    //Check access level and MOStlyCE Admin preference.  Set editor items accordingly.
    //Script Elements (Only loads for Admin)
    if ($adminside > 0 && $editor_script_acl == 'true') {
        $elements[] = "script[{$editor_script_elms}]";
    } else {
        $invalid_elements[] = "script";
    }
    //IFrame Elements (Only loads for Admin)
    if ($adminside > 0 && $editor_iframe_acl == 'true') {
        $elements[] = "iframe[{$editor_iframe_elms}]";
    }
    //Media Plugin
    if ($editor_plugin_media_acl == 'true') {
        $plugins[] = 'media';
    }
    //Font Options
    if ($editor_font_tools_acl == 'true') {
        $elements[] = "font[face|size|color|style]";
        $remove_font = false;
    } else {
        $remove_font = true;
    }
    //Emotions Plugin
    if ($editor_plugin_emotions_acl == 'true') {
        $plugins[] = 'emotions';
    }
    //Print Plugin
    if ($editor_plugin_print == 'true') {
        $plugins[] = 'print';
    }
    //Search & Replace Plugin
    if ($editor_plugin_searchreplace == 'true') {
        $plugins[] = 'searchreplace';
    }
    //Table Plugin
    if ($editor_plugin_table_acl == 'true') {
        $plugins[] = 'table';
    }
    //DateTime Plugin
    if ($editor_plugin_datetime_acl == 'true') {
        $plugins[] = 'insertdatetime';
    }
    //SpellChecker Plugin
    if ($editor_plugin_spellchecker == 'true') {
        $plugins[] = 'spellchecker';
    }
    //Layer Plugin
    if ($editor_plugin_layer == 'true') {
        $plugins[] = 'layer';
    }
    //Image/File Manager Plugin
    if ($editor_plugin_img_mgr == 'true') {
        $file_browser_callback = 'fileBrowserCallBack';
        //Setup a session variable for Image Manager security checks
        $mostlyceSessionRestore = session_id();
        $mostlyceRestoreKey = md5($mosConfig_secret . $_SERVER['REMOTE_ADDR']);
        $_SESSION['mostlyce_restore_key'] = $mostlyceRestoreKey;
        $_SESSION['mostlyce_usertype'] = $my->usertype;
    } else {
        $file_browser_callback = '';
    }
    //Paragraphs or breaks
    if ($editor_newlines == 'p') {
        $p_newlines = "true";
        $br_newlines = "false";
    }
    if ($editor_newlines == 'br') {
        $p_newlines = "false";
        $br_newlines = "true";
    }
    $css_template = $mosConfig_live_site . "/templates/" . $cur_template . "/css/";
    $content_css = $editor_css_override == '1' ? $css_template . $editor_custom_css : $css_template . "template_css.css";
    $editor_layout_row1 = renderButton(str_replace("\r\n", "", $editor_layout_row1), $remove_font);
    $editor_layout_row2 = renderButton(str_replace("\r\n", "", $editor_layout_row2), $remove_font);
    $editor_layout_row3 = renderButton(str_replace("\r\n", "", $editor_layout_row3), $remove_font);
    $editor_layout_row4 = renderButton(str_replace("\r\n", "", $editor_layout_row4), $remove_font);
    //Plugins List
    $plugins[] = $editor_extra_plugins;
    $plugins = implode(',', $plugins);
    $elements[] = $editor_xtd_elms;
    $elements = implode(',', $elements);
    $invalid_elements = implode(',', $invalid_elements);
    //Check TinyMCE compression setting and set correct file path
    if ($editor_compression == true) {
        $tinymce_file = "mambots/editors/mostlyce/jscripts/tiny_mce/tiny_mce_gzip.js";
    } else {
        $tinymce_file = "mambots/editors/mostlyce/jscripts/tiny_mce/tiny_mce.js";
    }
    return <<<EOD
<!--//TinyMCE/MOStlyCE-->\t
<script type="text/javascript" src="{$jspath}/{$tinymce_file}"></script>
<script type="text/javascript" src="{$jspath}/mambots/editors/mostlyce/jscripts/tiny_mce/mostlyce_functions.js"></script>
<script type="text/javascript">
if ({$editor_compression}==true) {
tinyMCE_GZ.init({
\tplugins : "{$plugins},preview,advlink,advimage,paste,fullscreen,directionality",
\tthemes : '{$editor_themes}',
\tlanguages : '{$editor_lang}',
\tdisk_cache : true,
\tdebug : false
});
}
</script>
<!-- Standard init and GZ init need to be in seperate script tags! -->
<script type="text/javascript">
\ttinyMCE.init({
\t    mode : "specific_textareas",
\t\ttheme : "{$editor_themes}",
\t\tlanguage : "{$editor_lang}",
        lang_list : "{$editor_lang_list}",
        table_color_fields : true,
        paste_use_dialog : true,
        advimage_constrain_proportions : true,
        invalid_elements: "{$invalid_elements}",
        force_br_newlines : "{$br_newlines}",
        force_p_newlines : "{$p_newlines}",
        directionality : "{$editor_direction}",
        file_browser_callback : "{$file_browser_callback}",
\t\tplugins : "{$plugins},preview,advlink,advimage,paste,fullscreen,directionality",
        theme_advanced_layout_manager : "RowLayout",
        theme_advanced_containers : "top1,top2,top3,top4,mceEditor,mceElementpath",
        theme_advanced_containers_default_class : "mceToolbar",
        theme_advanced_containers_default_align : "center",
        theme_advanced_container_top1_align : "left",
        theme_advanced_container_top2_align : "left",
        theme_advanced_container_top3_align : "left",
        theme_advanced_container_top4_align : "left",
        theme_advanced_container_top1 : "{$editor_layout_row1}",
        theme_advanced_container_top2 : "{$editor_layout_row2}",
        theme_advanced_container_top3 : "{$editor_layout_row3}",
        theme_advanced_container_top4 : "{$editor_layout_row4}",
        theme_advanced_container_top1_class : "mceToolbarTop",
        theme_advanced_container_top2_class : "mceToolbarTop",
        theme_advanced_container_top3_class : "mceToolbarTop",
        theme_advanced_container_top4_class : "mceToolbarTop",
        theme_advanced_container_mceElementpath_class : "mcePathBottom",
\t\twidth : "{$editor_width}",
        height : "{$editor_height}",
        mambo_base_url: "{$mosConfig_live_site}/",
        document_base_url: "{$mosConfig_live_site}/",
        content_css : "{$content_css}",
        plugin_insertdate_dateFormat : "{$editor_plugin_dateformat}",
    \tplugin_insertdate_timeFormat : "{$editor_plugin_timeformat}",
\t\textended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],{$elements}",
\t\ttheme_advanced_resize_horizontal : false,
\t\ttheme_advanced_resizing : true,
\t\tapply_source_formatting : false,
\t\tspellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv"
\t\t});
\t\t
\t\tfunction fileBrowserCallBack(field_name, url, type, win) {
\t\tvar connector = "../../filemanager/browser.php?Connector=connectors/php/connector.php&restore={$mostlyceSessionRestore}";
\t\tvar enableAutoTypeSelection = false;
\t\t
\t\tvar cType;
\t\ttinymcpuk_field = field_name;
\t\ttinymcpuk = win;
\t\t
\t\tswitch (type) {
\t\t\tcase "image":
\t\t\t\tcType = "Image";
\t\t\t\tbreak;
\t\t\tcase "flash":
\t\t\t\tcType = "Flash";
\t\t\t\tbreak;
\t\t\tcase "file":
\t\t\t\tcType = "File";
\t\t\t\tbreak;
\t\t\tcase "media":
\t\t\t\tcType = "Media";
\t\t\t\tbreak;
\t\t}
\t\t
\t\tif (enableAutoTypeSelection && cType) {
\t\t\tconnector += "&Type=" + cType;
\t\t}
\t\t
\t\twindow.open(connector, "tinymcpuk", "modal,width=600,height=400");
\t}
</script>
<!-- /tinyMCE -->
EOD;
}