Skip to content
Snippets Groups Projects
Commit faf8a0f6 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

empty default view

parent 325b31b6
No related branches found
No related tags found
No related merge requests found
......@@ -9,17 +9,14 @@
*/
class DefaultController extends Controller {
const moduleTitle = "EGPC : Etat Généraux des pouvoirs citoyens";
public $keywords = "connecter, réseau, sociétal, citoyen, société, regrouper, commune, communecter, social";
public $description = "Etat Généraux des pouvoirs citoyens : Connecter a sa commune, reseau societal, le citoyen au centre de la société.";
public static $moduleKey = "egpc";
const moduleTitle = "SIG";
public $keywords = "";
public $description = "";
public static $moduleKey = "sig";
//tu peux utiliser ceci comm ton menu
public $sidebar1 = array(
array('label' => "Qui", "key"=>"home","href"=>"javascript:;","onclick"=>"hideShow('.home')"),
array('label' => "Quand", "key"=>"when","href"=>"javascript:;","onclick"=>"hideShow('.when')"),
array('label' => "Pourquoi", "key"=>"why","href"=>"javascript:;","onclick"=>"hideShow('.why')"),
array('label' => "Quoi", "key"=>"what","href"=>"javascript:;","onclick"=>"hideShow('.what')"),
array('label' => "Mixitup", "key"=>"how","href"=>"egpc?tpl=mixitup"),
);
protected function beforeAction($action)
......@@ -34,48 +31,10 @@ class DefaultController extends Controller {
*/
public function actionIndex()
{
$searchTags = array();
if(isset($_GET['tags']))
{
foreach (explode(",", $_GET['tags']) as $key)
array_push($searchTags, array("tags"=>$key));
}
$params = array("app"=>$this::$moduleKey,
"fields"=>array("name","email","tags"));
if(count($searchTags))
$params["tags"] = array('$or'=>$searchTags);
$params["where"] = array('$or' => array( array( "type"=>"association" ),
array( "type"=>"entreprise" ),
array( "type"=>"group" )));
$groups = Group::getGroupsBy( $params );
$tagsall = Group::getGroupsBy( array("app"=>$this::$moduleKey , "fields"=>array("tags")));
$alltags = array();
foreach ($tagsall as $key => $value)
{
if(isset($value["tags"]))
{
foreach ( $value["tags"] as $t )
{
if(!in_array($t, $alltags))
{
array_push($alltags, $t);
}
}
}
}
$events = Group::getGroupsBy( array("where"=>array("applications.".$this::$moduleKey.".usertype"=>"event") , "fields"=>array("name","date")));
$msgs = Message::getMessagesBy( array("where"=>array("applications.".$this::$moduleKey.".usertype"=>"message") , "fields"=>array("msg","created")));
$tpl = (isset($_GET['tpl'])) ? $_GET['tpl'] : "index";
$this->render( $tpl , array( "groups" => $groups ,
"tagsall"=>$alltags,
"msgs"=>$msgs,
"events"=>$events ) );
$this->render( "index" );
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment