Commit 73921f49 authored by Tibor Katelbach's avatar Tibor Katelbach

tab switcher

parent cc7d3c7e
...@@ -1101,6 +1101,7 @@ var urlCtrl = { ...@@ -1101,6 +1101,7 @@ var urlCtrl = {
// location.hash.indexOf("#default.directory"), CoAllReadyLoad); // location.hash.indexOf("#default.directory"), CoAllReadyLoad);
onchangeClick=false; onchangeClick=false;
navInSlug=false; navInSlug=false;
mylog.log("loadByHash", hash, back ); mylog.log("loadByHash", hash, back );
if(typeof globalTheme != "undefined" && globalTheme=="network"){ if(typeof globalTheme != "undefined" && globalTheme=="network"){
mylog.log("globalTheme", globalTheme); mylog.log("globalTheme", globalTheme);
...@@ -1623,7 +1624,17 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) { ...@@ -1623,7 +1624,17 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) {
/*setTimeout(function(){$("#loadingModal").css({"opacity": 0.});}, 500); /*setTimeout(function(){$("#loadingModal").css({"opacity": 0.});}, 500);
setTimeout(function(){$("#loadingModal").css({"opacity": 0.5});}, 1500);*/ setTimeout(function(){$("#loadingModal").css({"opacity": 0.5});}, 1500);*/
$("#loadingModal").css({"opacity": 0.9}); $("#loadingModal").css({"opacity": 0.9});
getAjax(dest, url, function(data){
params = null;
if(activeModuleId == "costum" ){
mylog.log("costum LBH", costum.slug, contextData );
if(contextData && contextData.id)
params = { costumSlug : costum.slug, costumId : contextData.id, costumType : contextData.type };
else
params = { costumSlug : costum.slug };
}
ajaxPost(dest, url,params, function(data){
if( dest != themeObj.mainContainer ) if( dest != themeObj.mainContainer )
$(".subModuleTitle").html(""); $(".subModuleTitle").html("");
......
...@@ -634,6 +634,9 @@ class CommunecterController extends Controller ...@@ -634,6 +634,9 @@ class CommunecterController extends Controller
"siteurl" => array( "siteurl" => array(
"incnbclick" => array('href' => "ph/co2/siteurl/incnbclick") "incnbclick" => array('href' => "ph/co2/siteurl/incnbclick")
), ),
"co" => array(
"index" => array('href' => "ph/costum/co/index")
),
"cooperation" => array( "cooperation" => array(
"getcoopdata" => array('href' => "ph/co2/cooperation/getcoopdata"), "getcoopdata" => array('href' => "ph/co2/cooperation/getcoopdata"),
"savevote" => array('href' => "ph/co2/cooperation/savevote"), "savevote" => array('href' => "ph/co2/cooperation/savevote"),
...@@ -667,14 +670,38 @@ class CommunecterController extends Controller ...@@ -667,14 +670,38 @@ class CommunecterController extends Controller
), ),
); );
function initPage(){ function initPage(){
//review the value of the userId to check loosing session //review the value of the userId to check loosing session
//creates an issue with Json requests : to clear add josn:true on the page definition here //creates an issue with Json requests : to clear add josn:true on the page definition here
//if( Yii::app()->request->isAjaxRequest && (!isset( $page["json"] )) ) //if( Yii::app()->request->isAjaxRequest && (!isset( $page["json"] )) )
//echo "<script type='text/javascript'> userId = '".Yii::app()->session['userId']."'; var blackfly = 'sosos';</script>";
//bug du double load
//echo "<script type='text/javascript'> alert('CommunecterController initPage ".@$_POST["costumSlug"]." =? ".@Yii::app()->session[ "costum" ][ "slug" ]."'); </script>";
if( isset($_POST["costumSlug"]) ){
if( isset($_POST["costumId"]) && isset($_POST["costumId"]) ){
Costum::init( null, $_POST["costumId"], $_POST["costumType"] );
}
//pas d'element fourni juste un slug de costum
else
Costum::init( null, $_POST["costumSlug"] );
//var_dump(Yii::app()->session[ "costum" ]);
}
// if( isset($_POST["costumSlug"]) && @Yii::app()->session[ "costum" ][ "slug" ] != $_POST["costumSlug"] )
// {
// //echo "<script type='text/javascript'> alert('CommunecterController reload init ".@$_POST["costumSlug"]." != ".@Yii::app()->session[ "costum" ][ "slug" ]."'); </script>";
// //cas ou l'on se base sur un element qui pointra vers un template costum
// if( isset($_POST["costumId"]) && isset($_POST["costumId"]) ){
// Costum::init( null, $_POST["costumId"], $_POST["costumType"] );
// var_dump(Yii::app()->session[ "costum" ]);
// //echo "<script type=Yii::app()->session[ "costum" ]);'text/javascript'> alert('set session ".@$_POST["costumId"]." ".@$_POST["costumType"]."'); </script>";
// }
// //pas d'element fourni juste un slug de costum
// else
// Costum::init( null, $_POST["costumSlug"] );
// }
Yii::app()->params["version"] = $this->version ; Yii::app()->params["version"] = $this->version ;
if( @$_GET["theme"] ){ if( @$_GET["theme"] ){
Yii::app()->theme = $_GET["theme"]; Yii::app()->theme = $_GET["theme"];
......
<?php
$cssJS = array(
'/plugins/jQuery-Knob/js/jquery.knob.js',
'/plugins/jQuery-Smart-Wizard/js/jquery.smartWizard.js',
//'/plugins/jQuery-Smart-Wizard/styles/smart_wizard.css',
// SHOWDOWN
'/plugins/showdown/showdown.min.js',
// MARKDOWN
'/plugins/to-markdown/to-markdown.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
?>
<style type="text/css"> <style type="text/css">
#docs-main-container{ #docs-main-container{
position: absolute; position: absolute;
...@@ -160,7 +173,7 @@ ...@@ -160,7 +173,7 @@
<?php <?php
if(@Yii::app()->session["costum"] && @Yii::app()->session["costum"]["docTpl"]){ if(@Yii::app()->session["costum"] && @Yii::app()->session["costum"]["docTpl"]){
$this->renderPartial(Yii::app()->session["costum"]["docTpl"],false,true); $this->renderPartial( Yii::app()->session["costum"]["docTpl"] ,true);
} else { ?> } else { ?>
<div id="docs-main-container"> <div id="docs-main-container">
<div id="header-doc" class="shadow2"> <div id="header-doc" class="shadow2">
...@@ -336,6 +349,8 @@ var page="<?php echo @$page ?>"; ...@@ -336,6 +349,8 @@ var page="<?php echo @$page ?>";
var dir="<?php echo @$dir ?>"; var dir="<?php echo @$dir ?>";
jQuery(document).ready(function() { jQuery(document).ready(function() {
mylog.log("render","co2.views.docs.index");
dir=(dir=="") ? mainLanguage : dir; dir=(dir=="") ? mainLanguage : dir;
if(page != "") if(page != "")
initDocs(page, dir); initDocs(page, dir);
...@@ -343,7 +358,7 @@ jQuery(document).ready(function() { ...@@ -343,7 +358,7 @@ jQuery(document).ready(function() {
initDocs("welcome", mainLanguage); initDocs("welcome", mainLanguage);
$(".link-docs-menu").off().on("click",function(){ $(".link-docs-menu").off().on("click",function(){
alert(".link-docs-menu");
if($(this).hasClass("down-menu")){ if($(this).hasClass("down-menu")){
$("#menu-left > ul > li > a").removeClass("active").find("i").removeClass("fa-angle-down").addClass("fa-angle-right"); $("#menu-left > ul > li > a").removeClass("active").find("i").removeClass("fa-angle-down").addClass("fa-angle-right");
$(".subMenu .link-docs-menu").removeClass("active"); $(".subMenu .link-docs-menu").removeClass("active");
...@@ -369,8 +384,11 @@ jQuery(document).ready(function() { ...@@ -369,8 +384,11 @@ jQuery(document).ready(function() {
//if(moduleId == activeModuleId) //if(moduleId == activeModuleId)
// moduleInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get")); // moduleInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get"));
//else //else
navInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get")); navInDocs($(this).data("type"), $(this).data("dir"), $(this).data("get"));
}); });
$("#show-menu-xs").click(function(){ $("#show-menu-xs").click(function(){
if(!$(this).hasClass("show-dir")){ if(!$(this).hasClass("show-dir")){
$(this).addClass("show-dir").data("title", "<?php echo Yii::t("common","Close") ?>").find("i").removeClass("fa-chevron-right").addClass("fa-times"); $(this).addClass("show-dir").data("title", "<?php echo Yii::t("common","Close") ?>").find("i").removeClass("fa-chevron-right").addClass("fa-times");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment