Commit b02e8a5f authored by Raph El's avatar Raph El

Merge branch 'master' into cressReunionHotfix

parents 5874a4c6 fec1051e
......@@ -831,6 +831,73 @@ class CommunecterController extends Controller
Application::loadDBAppConfig();
}
function meta($c) {
/* var_dump($c["host"]);
var_dump($this->module->relCanonical);
var_dump($c["url"]);
var_dump(Yii::app()->getRequest()->getBaseUrl(true));
var_dump(str_replace("wwww.", "", $c["host"])); */
if(isset($c["host"])){
$this->module->relCanonical = "https://".$c["host"];
} else if (isset($this->module->relCanonical))
$this->module->relCanonical = Yii::app()->createUrl($c["url"]);
if(isset($c["metaDesc"]))
$shortDesc=$c["metaDesc"];
else{
$shortDesc = @$c["shortDescription"] ? $c["shortDescription"] : "";
if($shortDesc=="")
$shortDesc = @$c["description"] ? $c["description"] : "";
}
if(isset($c["language"])){
Yii::app()->language=$c["language"];
}
$this->module->description = $shortDesc;
$this->module->pageTitle = (isset($c["metaTitle"])) ? $c["metaTitle"] : @$c["title"];
$this->module->author = (isset($c["metaTitle"])) ? $c["metaTitle"] : @$c["title"];
if(isset($c["metaKeywords"]))
$this->module->keywords = $c["metaKeywords"];
else
$this->module->keywords = (@$c["tags"]) ? implode(",", @$c["tags"]) : "";
if (isset($c["favicon"])) {
$mod = $this->module->id;
//ex images can be given
if( substr_count($c["favicon"], '#') ){
$pieces = explode("#", $c["favicon"]);
$mod = $pieces[0];
$c["favicon"] = $pieces[1];
}
$this->module->favicon = Yii::app()->getModule( $mod )->getAssetsUrl().$c["favicon"];
}
if (@$c["metaImg"]) {
$mod = $this->module->id;
//ex images can be given
if( substr_count($c["metaImg"], '#') ){
$pieces = explode("#", $c["metaImg"]);
$mod = $pieces[0];
$c["metaImg"] = $pieces[1];
}
$this->module->image = Yii::app()->getModule( $mod )->getAssetsUrl().$c["metaImg"];
}
else if(@$c["logo"]){
$mod = $this->module->id;
//ex images can be given
if( substr_count($c["logo"], '#') ){
$pieces = explode("#", $c["logo"]);
$mod = $pieces[0];
$c["logo"] = $pieces[1];
}
$this->module->image = $c["logo"];
}
if(@$c["logo"]){
$this->module->image = $c["logo"];
}
//var_dump($this->module->relCanonical);
//exit;
}
function cacheCostumInit($slug,$returnCostum=null){
if(CacheHelper::get($slug)){
$cacheCostum = CacheHelper::get($slug);
......
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