Exemple #1
0
 * @version     1.2.13
 * @access      public
 * @since       1.0.0
 */
error_reporting(E_ALL);
include_once "wsp/config/config.inc.php";
include_once "wsp/includes/utils_session.inc.php";
$__AJAX_PAGE__ = true;
// use for return catch exception and loadAllVariables method
$__AJAX_LOAD_PAGE__ = true;
$__PAGE_IS_INIT__ = false;
$__LOAD_VARIABLES__ = false;
$__DEBUG_PAGE_IS_PRINTING__ = false;
$__GEOLOC_ASK_USER_SHARE_POSITION__ = false;
@session_set_cookie_params(0, "/", $_SERVER['SERVER_NAME'], false, true);
@session_name(formalize_to_variable(SITE_NAME));
if (isset($_COOKIE['WSP_WS_SESSION'])) {
    session_id($_COOKIE['WSP_WS_SESSION']);
} else {
    @session_start();
    if (!defined('MAX_SESSION_TIME')) {
        define("MAX_SESSION_TIME", 1800);
        // 30 min.
    }
    if (isset($_SESSION['WSP_LAST_ACTIVITY']) && time() - $_SESSION['WSP_LAST_ACTIVITY'] > MAX_SESSION_TIME) {
        session_unset();
        session_destroy();
    }
    $_SESSION['WSP_LAST_ACTIVITY'] = time();
}
include_once "wsp/includes/execution_time.php";
Exemple #2
0
 /**
  * Method render
  * @access public
  * @param boolean $ajax_render [default value: false]
  * @return string html code of object Tabs
  * @since 1.0.35
  */
 public function render($ajax_render = false)
 {
     $is_ajax_content = false;
     $html = "";
     $html .= "<div id=\"" . $this->getId() . "\"";
     if ($this->min_height != "" || $this->height != "" || $this->width != "") {
         $html .= " style=\"";
         if ($this->min_height != "") {
             $html .= "min-height:" . $this->min_height . "px;height: expression(this.scrollHeight < " . $this->min_height . " ? '" . $this->min_height . "px' : 'auto');";
         }
         if ($this->height != "") {
             $html .= "height:" . $this->height . "px;";
         }
         if ($this->width != "") {
             $html .= "width:" . $this->width . "px;";
         }
         $html .= "\"";
     }
     $html .= ">\n";
     $html .= "\t<ul>\n";
     for ($i = 0; $i < sizeof($this->array_tabs_name); $i++) {
         $html .= "\t\t<li>";
         if ($this->tagH != "") {
             $html .= "<" . $this->tagH . " style=\"font-weight:inherit;\">";
         }
         $html .= "<a href=\"";
         if (get_class($this->array_tabs_content[$i]) != "Url") {
             $html .= "#" . $this->getId() . "_" . formalize_to_variable($this->array_tabs_name[$i]);
         } else {
             $tmp_url = $this->array_tabs_content[$i]->render($ajax_render);
             if (!$this->ajax_loading) {
                 $html .= $tmp_url;
             } else {
                 $is_ajax_content = true;
                 $tmp_url = str_replace(".php", ".call", $tmp_url);
                 $html .= $tmp_url;
                 if (find($tmp_url, "?", 0, 0) > 0) {
                     $html .= "&tabs_object_id=" . $this->getId();
                 } else {
                     $html .= "?tabs_object_id=" . $this->getId();
                 }
             }
         }
         $html .= "\"><span>" . $this->array_tabs_name[$i] . "</span></a>";
         if ($this->tagH != "") {
             $html .= "</" . $this->tagH . ">";
         }
         $html .= "</li>\n";
     }
     $html .= "\t</ul>\n";
     for ($i = 0; $i < sizeof($this->array_tabs_name); $i++) {
         if (get_class($this->array_tabs_content[$i]) != "Url") {
             if (gettype($this->array_tabs_content[$i]) == "object" && method_exists($this->array_tabs_content[$i], "render")) {
                 $html_content = $this->array_tabs_content[$i]->render($ajax_render);
             } else {
                 $html_content = $this->array_tabs_content[$i];
             }
             $html .= "\t<div id=\"" . $this->getId() . "_" . formalize_to_variable($this->array_tabs_name[$i]) . "\" style=\"padding:5px;";
             if ($this->width != "") {
                 $html .= "width:" . ($this->width - 10) . "px;";
             }
             $html .= "\">\n";
             $html .= $html_content;
             $html .= "\t</div>\n";
         }
     }
     $html .= "</div>\n";
     $html .= $this->getJavascriptTagOpen();
     $html .= "\$(document).ready(function() {\n";
     $html .= "\t\$('#" . $this->getId() . "').tabs({";
     if ($this->onshow != "") {
         $html .= "\t\tshow: function(event, ui) { " . $this->onshow . " }, \n";
     }
     $html .= "\t\tselect: function(event, ui) {\n";
     for ($i = 0; $i < sizeof($this->array_tabs_select_js); $i++) {
         $html .= "\t\t\tif (ui.index == " . $i . ") {\n";
         $html .= "\t\t\t\tif (\$(ui.panel).html() == '') { \$(ui.panel).append(\"";
         if ($this->array_tabs_loading_content[$i] != "") {
             if (gettype($this->array_tabs_loading_content[$i]) == "object" && method_exists($this->array_tabs_loading_content[$i], "render")) {
                 $html .= str_replace("\"", "'", str_replace("\n", "", str_replace("\r", "", $this->array_tabs_loading_content[$i]->render())));
             } else {
                 $html .= str_replace("\"", "'", str_replace("\n", "", str_replace("\r", "", $this->array_tabs_loading_content[$i])));
             }
         } else {
             $html .= "<div align='center' style='#position:absolute;#top:50%;display:table-cell;vertical-align:middle;'><img src='" . $this->getPage()->getCDNServerURL() . "wsp/img/loading.gif' width='32' height='32' /></div>";
         }
         $html .= "\"); }\n";
         if ($this->array_tabs_select_js[$i] != "") {
             $html .= "\t\t\t\t" . $this->array_tabs_select_js[$i] . "\n";
         }
         if ($this->height != "") {
             $html .= "\t\t\t\t\$('#' + ui.panel.id).attr('style', 'overflow:auto;height:' + (parseInt(\$('#" . $this->getId() . "').css('height').replace('px', ''))-(\$('#" . $this->getId() . "').find('.ui-tabs-nav').height()+40)) + 'px;');\n";
         }
         if (!$this->ajax_loading) {
             $html .= "\t\t\t\tvar url = \$.data(ui.tab, 'load.tabs');\n";
             $html .= "\t\t\t\tif (url) {\n";
             $html .= "\t\t\t\t\tlocation.href = url;\n";
             $html .= "\t\t\t\t\treturn false;\n";
             $html .= "\t\t\t\t}\n";
         }
         $html .= "\t\t\t\treturn true;\n";
         $html .= "\t\t\t}\n";
     }
     $html .= "\t\t\treturn false;\n";
     $html .= "\t\t}\n";
     if ($this->cache) {
         $html .= "\t\t, cache: true\n";
     }
     if ($this->selected_index > -1) {
         $html .= "\t\t, selected: " . $this->selected_index . "\n";
     }
     $disabled_html = "";
     $is_disabled = false;
     for ($i = 0; $i < sizeof($this->array_tabs_disabled); $i++) {
         if ($this->array_tabs_disabled[$i]) {
             if ($is_disabled) {
                 $disabled_html .= ",";
             }
             $disabled_html .= $i;
             $is_disabled = true;
         }
     }
     if ($is_disabled) {
         $html .= "\t\t, disabled: [" . $disabled_html . "]\n";
     }
     if ($is_ajax_content) {
         $html .= "\t\t, ajaxOptions: {\n";
         if ($this->cache) {
             $html .= "\t\t\tcache: true,\n";
         }
         $html .= "\t\t\tsuccess: function() {},\n";
         $html .= "\t\t\terror: function (xhr, status, index, anchor) { if (status == 'error' && xhr.responseText != '') { \$(anchor.hash).html('<table><tr><td><img src=\\'" . $this->getPage()->getCDNServerURL() . "wsp/img/warning.png\\' height=\\'24\\' width=\\'24\\' border=\\'0\\' align=\\'absmidlle\\'/></td><td><b>Error</b></td></tr></table>' + (xhr.statusText != 'undefined' ? xhr.statusText : xhr.responseText)); } }\n";
         $html .= "\t\t}\n";
     }
     $html .= "});\n";
     if ($this->selected_index > -1 && $this->height != "") {
         $html .= "\$('#" . $this->getId() . "_" . formalize_to_variable($this->array_tabs_name[$this->selected_index]) . "').attr('style', 'overflow:auto;height:' + (parseInt(\$('#" . $this->getId() . "').css('height').replace('px', ''))-(\$('#" . $this->getId() . "').find('.ui-tabs-nav').height()+40)) + 'px;');\n";
     }
     $html .= "});\n";
     $html .= $this->getJavascriptTagClose();
     $this->object_change = false;
     return $html;
 }
Exemple #3
0
		<?php 
        }
    }
    ?>
		</script>
		
		<?php 
    if (is_browser_ie_6() && !isset($_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)]) && $_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)] != "ok") {
        $alternative_browser = '';
        $alternative_browser .= '<a href="http://www.mozilla.com/"><img src="' . BASE_URL . 'wsp/img/Firefox_128x128.png" height="60" width="60" border="0" title="Mozilla FireFox"/></a> ';
        $alternative_browser .= '<a href="http://www.microsoft.com/windows/internet-explorer/"><img src="' . BASE_URL . 'wsp/img/IE_128x128.png" height="60" width="60" border="0" title="Internet Explorer"/></a> ';
        $alternative_browser .= '<a href="http://www.apple.com/safari/"><img src="' . BASE_URL . 'wsp/img/Safari_128x128.png" height="60" width="60" border="0" title="Safari"/></a> ';
        $alternative_browser .= '<a href="http://www.google.com/chrome"><img src="' . BASE_URL . 'wsp/img/Chrome_128x128.png" height="60" width="60" border="0" title="Chrome"/></a> ';
        $alternative_browser .= '<a href="http://www.opera.com/browser/"><img src="' . BASE_URL . 'wsp/img/Opera_128x128.png" height="60" width="60" border="0" title="Opera"/></a> ';
        $page_object->addObject(new DialogBox(__(NOT_SUPPORTED_BROWSER_TITLE), "<br/>" . __(NOT_SUPPORTED_BROWSER) . $alternative_browser . "<br/>"));
        $_SESSION['WSP_IE6_MSG_' . formalize_to_variable(SITE_NAME)] = "ok";
    }
    // call current page page
    if (DEBUG) {
        $page_object->addLogDebugExecutionTime("Render ...");
    }
    echo str_replace("\n\n", "\n", str_replace("\r", "", str_replace("{#wsp_tab}", "\t", str_replace("\t", "", $page_object->render()))));
    if (DEBUG) {
        $page_object->displayExecutionTime("End Render");
    }
    ?>
		<!-- Please support the project: don't remove the WSP copyright -->
		<div align="center" id="wsp-copyright">
			<img src="http://www.website-php.com/img/logo_16x16.png" height="16" width="16" align="absmiddle"/> Site created with framework <a href="http://www.website-php.com" target="_blank">WebSite-PHP</a>
		</div>
		<script type="text/javascript">
Exemple #4
0
 public function configureSite()
 {
     $data_config_file = "<?php\n";
     $site_name = $this->btnValidateF1->isClicked() ? utf8_decode($this->edtName->getValue()) : $this->edtName->getValue();
     $data_config_file .= "define(\"SITE_NAME\", \"" . str_replace("\"", "\\\"", $site_name) . "\");\n";
     $data_config_file .= "define(\"SITE_DESC\", \"" . str_replace("\"", "\\\"", html_entity_decode($this->edtDesc->getValue(), ENT_QUOTES)) . "\");\n";
     $data_config_file .= "define(\"SITE_KEYS\", \"" . str_replace("\"", "\\\"", $this->btnValidateF1->isClicked() ? utf8_decode($this->edtKey->getValue()) : $this->edtKey->getValue()) . "\");\n";
     $data_config_file .= "define(\"SITE_RATING\", \"" . $this->cmbRating->getValue() . "\"); // general, mature, restricted, 14years\n";
     $data_config_file .= "define(\"SITE_AUTHOR\", \"" . str_replace("\"", "\\\"", $this->edtAuthor->getValue()) . "\");\n";
     $data_config_file .= "define(\"SITE_DEFAULT_LANG\", \"" . $this->cmbLanguage->getValue() . "\"); // en, fr, ...\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"SITE_META_OPENGRAPH_TYPE\", \"" . $this->cmbSiteType->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_OPENGRAPH_IMAGE\", \"" . $this->edtSiteImage->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_IPHONE_IMAGE_57PX\", \"" . $this->edtSiteIphoneImage57->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_IPHONE_IMAGE_72PX\", \"" . $this->edtSiteIphoneImage72->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_IPHONE_IMAGE_114PX\", \"" . $this->edtSiteIphoneImage114->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_IPHONE_IMAGE_152PX\", \"" . $this->edtSiteIphoneImage152->getValue() . "\");\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"GOOGLE_CODE_TRACKER\", \"" . $this->edtGoogleTracker->getValue() . "\");\n";
     //$data_config_file .= "define(\"GOOGLE_MAP_KEY\", \"".$this->edtGoogleMapKey->getValue()."\");\n";
     $data_config_file .= "define(\"GOOGLE_MAP_KEY\", \"" . GOOGLE_MAP_KEY . "\"); // Deprecated (We recommand to use MapLeafLet)\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"SITE_META_ROBOTS\", \"" . $this->cmbMetaRobots->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_GOOGLEBOTS\", \"" . $this->cmbMetaGooglebot->getValue() . "\");\n";
     $data_config_file .= "define(\"SITE_META_REVISIT_AFTER\", " . $this->edtRevisitAfter->getValue() . ");\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"CACHING_ALL_PAGES\", " . $this->cmbCachingAllPage->getValue() . "); // If use user rights, warning, you may have rights problems\n";
     $data_config_file .= "define(\"CACHE_TIME\", ";
     if ($this->cmbCachingAllPage->getValue() == "false") {
         $data_config_file .= "0";
     } else {
         $data_config_file .= $this->edtCacheTime->getValue();
     }
     $data_config_file .= "); // 12 heures = 60*60*12\n";
     //$data_config_file .= "define(\"LITE_PHP_BROWSCAP\", ".$this->cmbBrowscap->getValue()."); // is lite or normal version of Browscap used\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"JQUERY_LOAD_LOCAL\", " . $this->cmbJqueryLocal->getValue() . "); // if false load jquery from google else load from local\n";
     $data_config_file .= "define(\"JQUERY_VERSION\", \"" . $this->cmbJQueryVersion->getValue() . "\");\n";
     $data_config_file .= "define(\"JQUERY_UI_VERSION\", \"" . $this->cmbJQueryUIVersion->getValue() . "\");\n";
     //$data_config_file .= "define(\"JS_COMPRESSION_TYPE\", \"".$this->cmbJsCompression->getValue()."\"); // type of Javascript compression (GOOGLE_WS, LOCAL, NONE)\n";
     $data_config_file .= "define(\"JS_COMPRESSION_TYPE\", \"NONE\"); // Javascript compression (GOOGLE_WS, LOCAL, NONE (recommand))\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"DEBUG\", " . $this->cmbDebug->getValue() . "); // autorize use of method addLogDebug\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"SEND_ERROR_BY_MAIL\", " . $this->cmbSendErrorByMail->getValue() . "); // send error by mail if not local URL (http://127.0.0.1/)\n";
     $data_config_file .= "define(\"SEND_ERROR_BY_MAIL_TO\", \"" . $this->edtSendErrorByMailTo->getValue() . "\"); // send error to this email\n";
     $data_config_file .= "define(\"SEND_JS_ERROR_BY_MAIL\", " . $this->cmbSendJsErrorByMail->getValue() . "); // send JS error by mail if not local URL (http://127.0.0.1/)\n";
     if ($this->btnValidateF2->isClicked()) {
         $list_files = "";
         for ($i = 0; $i < $this->hidden_nb_exclude_files->getValue(); $i++) {
             if ($this->edt_exclude_files[$i]->getValue() != "") {
                 if ($list_files != "") {
                     $list_files .= ",";
                 }
                 $list_files .= str_replace("'", "", str_replace("\"", "", str_replace(",", "", $this->edt_exclude_files[$i]->getValue())));
             }
         }
         $data_config_file .= "define(\"SEND_BY_MAIL_FILE_EX\", \"" . trim($list_files) . "\"); // list of files exluded by send error by mail\n";
     } else {
         if (defined("SEND_BY_MAIL_FILE_EX")) {
             $data_config_file .= "define(\"SEND_BY_MAIL_FILE_EX\", \"" . SEND_BY_MAIL_FILE_EX . "\"); // list of files exluded by send error by mail\n";
         } else {
             $data_config_file .= "define(\"SEND_BY_MAIL_FILE_EX\", \"\"); // list of files exluded by send error by mail\n";
         }
     }
     $data_config_file .= "\n";
     $data_config_file .= "define(\"MAX_BAD_URL_BEFORE_BANNED\", " . $this->edtMaxBadUrlBeforeBan->getValue() . "); // Nb max URL before banned visitor\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"SEND_ADMIN_CONNECT_BY_MAIL\", " . $this->cmbSendAdminConnectByMail->getValue() . "); // send wsp-admin connection notice, if not local URL (http://127.0.0.1/)\n";
     $data_config_file .= "define(\"SEND_ADMIN_CONNECT_BY_MAIL_TO\", \"" . $this->edtSendAdminConnectByMailTo->getValue() . "\"); // send wsp-admin connection notice to this email\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"CDN_SERVER\", \"";
     if ($this->edtCdnServer->getValue() != "http://") {
         $data_config_file .= $this->edtCdnServer->getValue();
     }
     $data_config_file .= "\"); // CDN server URL (used to increase picture, JS and CSS loading time)\n";
     $data_config_file .= "define(\"FORCE_SERVER_NAME\", \"";
     if ($this->edtForceServerName->getValue() != "http://") {
         $data_config_file .= $this->edtForceServerName->getValue();
     }
     $data_config_file .= "\"); // Force site base url (problem with redirect), whithout http:// (ex: www.website-php.com)\n";
     $data_config_file .= "\n";
     $data_config_file .= "define(\"DEFAULT_TIMEZONE\", \"" . $this->edtDefaultTimezone->getValue() . "\");\n";
     $data_config_file .= "define(\"MAX_SESSION_TIME\", " . $this->edtMaxSessionTime->getValue() . "); // 30min. = 1800\n";
     $data_config_file .= "?>";
     $config_file = new File(dirname(__FILE__) . "/../../../wsp/config/config.inc.php", false, true);
     if ($config_file->write($data_config_file)) {
         $config_ok = true;
     }
     $config_file->close();
     if ($config_ok) {
         $result_dialogbox = new DialogBox(__(CONFIG_FILE), __(CONFIG_FILE_OK));
     } else {
         $result_dialogbox = new DialogBox(__(CONFIG_FILE), __(CONFIG_FILE_NOT_OK));
     }
     $result_dialogbox->activateCloseButton();
     $this->addObject($result_dialogbox);
     if (formalize_to_variable($site_name) != formalize_to_variable(SITE_NAME) && $this->userHaveRights()) {
         $this->redirect($this->getBaseLanguageURL() . "wsp-admin/disconnect.html?referer=" . urlencode(str_replace("ajax/", "", $this->getCurrentURL())));
     }
 }