get_user_groups($user); } else { $allgroups = $userlib->get_groups(0,-1,'groupName_desc',''); $user_groups = Array(); foreach($allgroups["data"] as $grp) { $user_groups[]=$grp["groupName"]; } } if($user_assigned_modules=='y' && $tiki_p_configure_modules =='y' && $user && $usermoduleslib->user_has_assigned_modules($user)) { $left_modules = $usermoduleslib->get_assigned_modules_user($user,'l'); $right_modules = $usermoduleslib->get_assigned_modules_user($user,'r'); } else { $left_modules = $tikilib->get_assigned_modules('l'); $right_modules = $tikilib->get_assigned_modules('r'); } //var_dump($left_modules); for($i=0;$i"); if(!$r["rows"]) $r["rows"]=10; $module_rows=$r["rows"]; parse_str($r["params"],$module_params); //$mnm = $r["name"]."_module_title"; //$smarty->assign_by_ref($mnm,$r["title"]); //$smarty->assign_by_ref('module_rows',$r["rows"]); if((!file_exists($cachefile)) || (file_exists($nocache)) || ( ($now - filemtime($cachefile))>$r["cache_time"] )){ //print("Refrescar cache
"); $r["data"]=''; if(file_exists($phpfile)) { //print("Haciendo el include
"); // If we have a php file then use it! include_once($phpfile); } // If there's a template we use it $template_file = 'templates/'.$template; //print("Template file: $template_file
"); if(file_exists($template_file)) { //print("FETCH
"); $data = $smarty->fetch($template); } else { if($tikilib->is_user_module($r["name"])) { //print("Es user module"); $info = $tikilib->get_user_module($r["name"]); // Ahora usar el template de user $smarty->assign_by_ref('user_title',$info["title"]); $smarty->assign_by_ref('user_data',$info["data"]); $data = $smarty->fetch('modules/user_module.tpl'); } } $r["data"] = $data; $fp = fopen($cachefile,"w+"); fwrite($fp,$data,strlen($data)); fclose($fp); } else { //print("Usando cache
"); $fp = fopen($cachefile,"r"); $data = fread($fp,filesize($cachefile)); fclose($fp); $r["data"] = $data; } } } for($i=0;$i"); if((!file_exists($cachefile)) || (file_exists($nocache)) || ( ($now - filemtime($cachefile))>$r["cache_time"] )){ $r["data"]=''; if(file_exists($phpfile)) { //print("Haciendo el include
"); // If we have a php file then use it! include_once($phpfile); } // If there's a template we use it $template_file = 'templates/'.$template; //print("Template file: $template_file
"); if(file_exists($template_file)) { //print("FETCH
"); $data = $smarty->fetch($template); } else { if($tikilib->is_user_module($r["name"])) { //print("Es user module"); $info = $tikilib->get_user_module($r["name"]); // Ahora usar el template de user $smarty->assign_by_ref('user_title',$info["title"]); $smarty->assign_by_ref('user_data',$info["data"]); $data = $smarty->fetch('modules/user_module.tpl'); } } $r["data"] = $data; $fp = fopen($cachefile,"w+"); fwrite($fp,$data,strlen($data)); fclose($fp); } else { //print("Usando cache
"); $fp = fopen($cachefile,"r"); $data = fread($fp,filesize($cachefile)); fclose($fp); $r["data"] = $data; } } } // // ATTENTION: Quick hack: remove modules not assigned to Anonymous group // if unregistered user here... (I'll send details to list soon) //if ($user) //{ $smarty->assign_by_ref('right_modules',$right_modules); $smarty->assign_by_ref('left_modules',$left_modules); /*} else { $rm = array(); foreach ($right_modules as $r) if (strstr($r["module_groups"], "Anonymous")) $rm[] = $r; $lm = array(); foreach ($left_modules as $r) if (strstr($r["module_groups"], "Anonymous")) $lm[] = $r; $smarty->assign_by_ref('right_modules',$rm); $smarty->assign_by_ref('left_modules',$lm); }*/ ?>