1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Site Class: code optimization.

This commit is contained in:
Awilum
2012-10-25 19:31:40 +03:00
parent 059af021fa
commit 29f4b18cec

View File

@@ -97,11 +97,7 @@
* @return string
*/
public static function title() {
// Get title
$title = call_user_func(ucfirst(Uri::command()).'::title');
return $title;
return call_user_func(ucfirst(Uri::command()).'::title');
}
@@ -115,15 +111,7 @@
* @return string
*/
public static function description() {
// Get description
$description = call_user_func(ucfirst(Uri::command()).'::description');
if (trim($description) !== '') {
return Html::toText($description);
} else {
return Html::toText(Option::get('description'));
}
return (trim(call_user_func(ucfirst(Uri::command()).'::description')) == '') ? Html::toText(Option::get('description')) : Html::toText($description);
}
@@ -137,16 +125,7 @@
* @return string
*/
public static function keywords() {
// Get keywords
$keywords = call_user_func(ucfirst(Uri::command()).'::keywords');
if (trim($keywords) !== '') {
return Html::toText($keywords);
} else {
return Html::toText(Option::get('keywords'));
}
return (trim(call_user_func(ucfirst(Uri::command()).'::keywords')) == '') ? Html::toText(Option::get('keywords')) : Html::toText($description);
}
@@ -174,11 +153,7 @@
* @return string
*/
public static function content() {
// Get content
$content = call_user_func(ucfirst(Uri::command()).'::content');
return Filter::apply('content', $content);
return Filter::apply('content', call_user_func(ucfirst(Uri::command()).'::content'));
}