/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionSetting()
 {
     $model = new OmmuLocale();
     $setting = OmmuSettings::model()->findByPk(1);
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['OmmuLocale'])) {
         $model->attributes = $_POST['OmmuLocale'];
         $jsonError = CActiveForm::validate($model);
         if (strlen($jsonError) > 2) {
             echo $jsonError;
         } else {
             if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                 if ($model->validate()) {
                     $locale = OmmuLocale::model()->findByPk($model->default_locale);
                     $timezone = OmmuTimezone::model()->findByPk($model->timezone);
                     $setting->site_dateformat = $model->dateformat;
                     $setting->site_timeformat = $model->timeformat;
                     if ($locale->update() && $timezone->update() && $setting->update()) {
                         echo CJSON::encode(array('type' => 0, 'msg' => '<div class="errorSummary success"><strong>' . Yii::t('phrase', 'Locale setting success updated.') . '</strong></div>'));
                     }
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     } else {
         $this->pageTitle = Yii::t('phrase', 'Locale Settings');
         $this->pageDescription = Yii::t('phrase', 'Please select a default timezone setting for your social network. This will be the default timezone applied to users\' accounts if they do not select a timezone during signup, or if they are not signed in. Select the default locale you want to use on your social network. This will affect the language of the dates that appear on your social network pages.');
         $this->pageMeta = '';
         $this->render('admin_setting', array('model' => $model, 'setting' => $setting));
     }
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'construction_date, construction_text'));
     $this->pageTitle = 'Contruction';
     $this->pageDescription = '';
     $this->pageMeta = '';
     $this->render('application.webs.maintenance.front_index', array('setting' => $setting));
 }
 /**
  * Initialize admin page theme
  */
 public function init()
 {
     $siteType = OmmuSettings::getInfo('site_type');
     if (!Yii::app()->user->isGuest) {
         if (in_array(Yii::app()->user->level, array(1, 2)) && $siteType == 1) {
             $arrThemes = Utility::getCurrentTemplate('admin');
             Yii::app()->theme = $arrThemes['folder'];
             $this->layout = $arrThemes['layout'];
         } else {
             $this->redirect(Yii::app()->createUrl('site/login'));
         }
     } else {
         $this->redirect(Yii::app()->createUrl('site/login'));
     }
 }
    echo $form->labelEx($model, 'comment_code');
    ?>
						<?php 
    echo $form->error($model, 'comment_code');
    ?>
					</div>
				</div>
				<?php 
} else {
    $model->comment_code = 0;
    echo $form->hiddenField($model, 'comment_code');
}
?>
	
				<?php 
if (OmmuSettings::getInfo('site_headline') == 1) {
    ?>
				<div class="clearfix publish">
					<?php 
    echo $form->labelEx($model, 'headline');
    ?>
					<div class="desc">
						<?php 
    echo $form->checkBox($model, 'headline');
    echo $form->labelEx($model, 'headline');
    ?>
						<?php 
    echo $form->error($model, 'headline');
    ?>
					</div>
				</div>
<?php 
//begin.Maps
?>
<div id="maps"></div>

<?php 
//begin.Address, Contact and Social Media
?>
<div class="address-social">
	<?php 
//begin.Address
?>
	<div class="address">
		<strong><?php 
echo $model->office_name != '' ? $model->office_name : OmmuSettings::getInfo('site_title');
?>
</strong><br/>
		<?php 
echo $model->office_place . '.<br/>' . $model->office_village . ', ' . $model->office_district . ',<br/>' . $model->view_meta->city . ', ' . $model->view_meta->province . ', ' . $model->view_meta->country . ',<br/>' . $model->office_zipcode;
?>
	</div>
	
	<?php 
//begin.Contact
?>
	<?php 
if ($model->office_phone != '' || $model->office_fax != '' || $model->office_hotline != '' || $model->office_email != '') {
    ?>
	<div class="contact">
		<strong>&nbsp;</strong><br/>
 /**
  * Lists all models.
  */
 public function actionSubscribe()
 {
     $model = new UserNewsletter();
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['UserNewsletter'])) {
         $model->attributes = $_POST['UserNewsletter'];
         $jsonError = CActiveForm::validate($model);
         if (strlen($jsonError) > 2) {
             echo $jsonError;
         } else {
             if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                 if ($model->save()) {
                     if ($model->user_id == 0) {
                         $get = Yii::app()->controller->createUrl('subscribe', array('name' => $model->email, 'email' => $model->email));
                     } else {
                         $get = Yii::app()->controller->createUrl('subscribe', array('name' => $model->user->displayname, 'email' => $model->user->email));
                     }
                     echo CJSON::encode(array('type' => 5, 'get' => $get));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     }
     $this->dialogDetail = true;
     $this->dialogGroundUrl = Yii::app()->createUrl('site/index');
     $this->dialogFixed = true;
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'online, construction_date'));
     if ($setting->online == 0 && date('Y-m-d', strtotime($setting->construction_date)) > date('Y-m-d')) {
         $launch = 0;
         $title = isset($_GET['name']) && isset($_GET['email']) ? Phrase::trans(23105, 1) : Phrase::trans(23103, 1);
         $desc = isset($_GET['name']) && isset($_GET['email']) ? '' : Phrase::trans(23104, 1);
     } else {
         $launch = 1;
         $this->dialogFixedClosed = array(Yii::t('phrase', 'Create Your Account') => Yii::app()->createUrl('users/signup/index'));
         $title = isset($_GET['name']) && isset($_GET['email']) ? Phrase::trans(23108, 1) : Phrase::trans(23106, 1);
         $desc = isset($_GET['name']) && isset($_GET['email']) ? '' : Phrase::trans(23107, 1);
     }
     $this->pageTitle = $title;
     $this->pageDescription = $desc;
     $this->pageMeta = '';
     $this->render('front_subscribe', array('model' => $model, 'launch' => $launch));
 }
 /**
  * Lists all models.
  */
 public function actionOffice()
 {
     $this->layout = false;
     $model = OmmuMeta::model()->findAll(array());
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'site_title'));
     $return = array();
     $return['maps'] = array('icon' => Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->request->baseUrl . '/public/marker_default.png', 'width' => 42, 'height' => 48);
     $i = 0;
     foreach ($model as $val) {
         $i++;
         $point = explode(',', $val->office_location);
         $return['data'][] = array('id' => $i, 'lat' => $point[0], 'lng' => $point[1], 'name' => $val->office_name != '' ? $val->office_name : $setting->site_title, 'address' => $val->office_place . '. ' . $val->office_village . ', ' . $val->office_district . ', ' . $val->view_meta->city . ', ' . $val->view_meta->province . ', ' . $val->view_meta->country . ', ' . $val->office_zipcode);
     }
     echo CJSON::encode($return);
 }
 /**
  * After save attributes
  */
 protected function afterSave()
 {
     parent::afterSave();
     $controller = strtolower(Yii::app()->controller->id);
     $currentAction = strtolower(Yii::app()->controller->id . '/' . Yii::app()->controller->action->id);
     // Generate Verification Code
     if ($this->verified == 0) {
         $verify = new UserVerify();
         $verify->user_id = $this->user_id;
         $verify->save();
     }
     if ($this->isNewRecord) {
         $setting = OmmuSettings::model()->findByPk(1, array('select' => 'site_type, signup_welcome, signup_adminemail'));
         if ($setting->site_type == 1) {
             $invite = UserInviteQueue::model()->findByAttributes(array('email' => strtolower($this->email)), array('select' => 'queue_id, member_id, reference_id'));
             if ($invite != null && $invite->member_id == 0) {
                 $invite->member_id = $this->user_id;
                 if ($this->referenceId != '') {
                     $invite->reference_id = $this->referenceId;
                 }
                 $invite->update();
             }
         }
         // Send Welcome Email
         if ($setting->signup_welcome == 1) {
             $welcome_search = array('{$baseURL}', '{$index}', '{$displayname}');
             $welcome_replace = array(Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->request->baseUrl, Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('site/index'), $this->displayname);
             $welcome_template = 'user_welcome';
             $welcome_title = 'Welcome to SSO-GTP by BPAD Yogyakarta';
             $welcome_message = file_get_contents(YiiBase::getPathOfAlias('webroot.externals.users.template') . '/' . $welcome_template . '.php');
             $welcome_ireplace = str_ireplace($welcome_search, $welcome_replace, $welcome_message);
             SupportMailSetting::sendEmail($this->email, $this->displayname, $welcome_title, $welcome_ireplace, 1);
         }
         // Send Account Information
         $account_search = array('{$baseURL}', '{$login}', '{$displayname}', '{$email}', '{$password}');
         $account_replace = array(Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->request->baseUrl, Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('site/login'), $this->displayname, $this->email, $this->newPassword);
         $account_template = 'user_welcome_account';
         $account_title = 'SSO-GTP Account (' . $this->displayname . ')';
         $account_message = file_get_contents(YiiBase::getPathOfAlias('webroot.externals.users.template') . '/' . $account_template . '.php');
         $account_ireplace = str_ireplace($account_search, $account_replace, $account_message);
         SupportMailSetting::sendEmail($this->email, $this->displayname, $account_title, $account_ireplace, 1);
         // Send New Account to Email Administrator
         if ($setting->signup_adminemail == 1) {
             SupportMailSetting::sendEmail($this->email, $this->displayname, 'New Member', 'informasi member terbaru', 0);
         }
     } else {
         // Send Account Information
         //if($this->enabled == 1) {}
         if ($controller == 'password') {
             $account_search = array('{$baseURL}', '{$login}', '{$displayname}', '{$email}', '{$password}');
             $account_replace = array(Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->request->baseUrl, Utility::getProtocol() . '://' . Yii::app()->request->serverName . Yii::app()->createUrl('site/login'), $this->displayname, $this->email, $this->newPassword);
             $account_template = 'user_forgot_new_password';
             $account_title = 'Your password changed';
             $account_message = file_get_contents(YiiBase::getPathOfAlias('webroot.externals.users.template') . '/' . $account_template . '.php');
             $account_ireplace = str_ireplace($account_search, $account_replace, $account_message);
             SupportMailSetting::sendEmail($this->email, $this->displayname, $account_title, $account_ireplace, 1);
         }
         if ($controller == 'verify') {
             SupportMailSetting::sendEmail($this->email, $this->displayname, 'Verify Email Success', 'Verify Email Success', 1);
         }
     }
 }
    ?>
</label>
						<?php 
    echo $form->error($model, 'comment_code');
    ?>
					</div>
				</div>
				<?php 
} else {
    $model->comment_code = 0;
    echo $form->hiddenField($model, 'comment_code');
}
?>

				<?php 
if (OmmuSettings::getInfo(site_headline) == '1') {
    ?>
				<div class="clearfix publish">
					<?php 
    echo $form->labelEx($model, 'headline');
    ?>
					<div class="desc">
						<?php 
    echo $form->checkBox($model, 'headline');
    ?>
<label><?php 
    echo $model->getAttributeLabel('headline');
    ?>
</label>
						<?php 
    echo $form->error($model, 'headline');
 /**
  * After save attributes
  */
 protected function afterSave()
 {
     parent::afterSave();
     if ($this->isNewRecord && $this->queue->member_id == 0) {
         $setting = OmmuSettings::model()->findByPk(1, array('select' => 'signup_checkemail'));
         if ($setting->signup_checkemail == 1) {
             SupportMailSetting::sendEmail($this->queue->email, $this->queue->email, 'User Invite', 'Silahkan bergabung dan masukkan code invite', 1);
         } else {
             SupportMailSetting::sendEmail($this->queue->email, $this->queue->email, 'User Invite', 'Silahkan bergabung', 1);
         }
     }
 }
 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionEdit()
 {
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
     } else {
         $id = Yii::app()->user->id;
     }
     $model = $this->loadModel($id);
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'signup_username, signup_approve, signup_verifyemail, signup_random'));
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['Users'])) {
         $model->attributes = $_POST['Users'];
         $model->scenario = 'formEdit';
         $jsonError = CActiveForm::validate($model);
         if (strlen($jsonError) > 2) {
             echo $jsonError;
         } else {
             if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                 if ($model->save()) {
                     echo CJSON::encode(array('type' => 5, 'get' => Yii::app()->controller->createUrl('manage'), 'id' => 'partial-users', 'msg' => '<div class="errorSummary success"><strong>Users success updated.</strong></div>'));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     }
     $this->dialogDetail = true;
     $this->dialogGroundUrl = isset($_GET['id']) ? Yii::app()->controller->createUrl('manage') : Yii::app()->createUrl('admin/dashboard');
     $this->dialogWidth = 600;
     $this->pageTitle = 'Update Users';
     $this->pageDescription = '';
     $this->pageMeta = '';
     $this->render('admin_edit', array('model' => $model, 'setting' => $setting));
 }
 /**
  * Manages all models.
  */
 public function actionManage()
 {
     $setting = OmmuSettings::model()->findByPk(1);
     $model = new OmmuLanguages('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['OmmuLanguages'])) {
         $model->attributes = $_GET['OmmuLanguages'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $model->getGridColumn($columnTemp);
     $this->pageTitle = Yii::t('phrase', 'Language Settings');
     $this->pageDescription = Yii::t('phrase', 'The layout of your social network includes hundreds of phrases of text which are stored in a language pack. SocialEngine comes with an English pack which is the default when you first install the platform. If you want to change any of these phrases on your social network, you can edit the pack below. If you want to allow users to pick from multiple languages, you can also create additional packs below. If you have multiple language packs, the pack you\'ve selected as your "default" will be the language that displays if a user has not selected any other language. Note: You can not delete the default language. To edit a language\'s details, click its name.');
     $this->pageMeta = '';
     $this->render('admin_manage', array('model' => $model, 'columns' => $columns, 'setting' => $setting));
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionAnalytics()
 {
     $model = OmmuSettings::model()->findByPk(1, array('select' => 'site_url, analytic, analytic_id'));
     $this->pageTitle = 'Analytics';
     $this->pageDescription = '';
     $this->pageMeta = '';
     $this->render('application.webs.site.front_analytics', array('model' => $model));
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = OmmuSettings::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
     }
     return $model;
 }
 /**
  * Get date format (general setting)
  */
 public static function dateFormat($date, $time = false)
 {
     $setting = OmmuSettings::model()->findByPk(1, array('select' => 'site_dateformat, site_timeformat'));
     if ($time == true) {
         $date = date($setting->site_dateformat, strtotime($date)) . ' ' . date($setting->site_timeformat, strtotime($date)) . ' WIB';
     } else {
         $date = date($setting->site_dateformat, strtotime($date));
     }
     return $date;
 }
 protected function renderContent()
 {
     $model = OmmuSettings::model()->findByPk(1, array('select' => 'site_url, analytic, analytic_id'));
     $this->render('front_google_analytics', array('model' => $model));
 }
 /**
  * Set default columns to display
  */
 protected function afterConstruct()
 {
     $controller = strtolower(Yii::app()->controller->id);
     if (count($this->defaultColumns) == 0) {
         /*
         $this->defaultColumns[] = array(
         	'class' => 'CCheckBoxColumn',
         	'name' => 'id',
         	'selectableRows' => 2,
         	'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
         );
         */
         $this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
         $this->defaultColumns[] = array('name' => 'title', 'value' => '$data->title."<br/><span>".Utility::shortText(Utility::hardDecode($data->body),200)."</span>"', 'htmlOptions' => array('class' => 'bold'), 'type' => 'raw');
         if (!isset($_GET['category'])) {
             $this->defaultColumns[] = array('name' => 'cat_id', 'value' => 'Phrase::trans($data->cat->name, 2)', 'filter' => AlbumCategory::getCategory(), 'type' => 'raw');
         }
         $this->defaultColumns[] = array('name' => 'photo_search', 'value' => 'CHtml::link($data->views->photos." photo", Yii::app()->controller->createUrl("o/photo/manage",array("album"=>$data->album_id)))', 'htmlOptions' => array('class' => 'center'), 'type' => 'raw');
         $this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_relation->displayname');
         $this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
         if (!isset($_GET['type'])) {
             if ($controller == 'o/admin' && OmmuSettings::getInfo('site_headline') == 1) {
                 $this->defaultColumns[] = array('name' => 'headline', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("headline",array("id"=>$data->album_id)), $data->headline, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
             }
             $this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->album_id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
         }
     }
     parent::afterConstruct();
 }
 /**
  * Set default columns to display
  */
 protected function afterConstruct()
 {
     $controller = strtolower(Yii::app()->controller->id);
     if (count($this->defaultColumns) == 0) {
         /*
         $this->defaultColumns[] = array(
         	'class' => 'CCheckBoxColumn',
         	'name' => 'id',
         	'selectableRows' => 2,
         	'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
         );
         */
         $this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
         $this->defaultColumns[] = array('name' => 'title', 'value' => '$data->title."<br/><span>".Utility::shortText(Utility::hardDecode($data->body),200)."</span>"', 'htmlOptions' => array('class' => 'bold'), 'type' => 'raw');
         $category = ArticleCategory::model()->findByPk($_GET['category']);
         if (!isset($_GET['category']) || isset($_GET['category']) && $category->dependency == 0) {
             if ($category->dependency == 0) {
                 $parent = $_GET['category'];
             } else {
                 $parent = null;
             }
             $this->defaultColumns[] = array('name' => 'cat_id', 'value' => 'Phrase::trans($data->cat->name, 2)', 'filter' => ArticleCategory::getCategory(null, $parent), 'type' => 'raw');
         }
         $this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_relation->displayname');
         $this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
         if (in_array($controller, array('o/admin'))) {
             $this->defaultColumns[] = array('name' => 'published_date', 'value' => 'Utility::dateFormat($data->published_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'published_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'published_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
         }
         if (!isset($_GET['type'])) {
             if (OmmuSettings::getInfo('site_headline') == 1) {
                 $this->defaultColumns[] = array('name' => 'headline', 'value' => '$data->headline == 1 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Utility::getPublish(Yii::app()->controller->createUrl("headline",array("id"=>$data->article_id)), $data->headline, 9)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
             }
             $this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->article_id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
         }
     }
     parent::afterConstruct();
 }
 /**
  * Meta description and keyword generate
  */
 protected function beforeRender($view)
 {
     $model = OmmuSettings::model()->findByPk(1, array('select' => 'site_title, site_keywords, site_description'));
     if (!Yii::app()->request->isAjaxRequest) {
         if (parent::beforeRender($view)) {
             // Ommu custom description and keyword
             if (!empty($this->pageDescription)) {
                 $description = $this->pageDescription;
             } else {
                 $description = $model->site_description;
             }
             Yii::app()->clientScript->registerMetaTag(Utility::hardDecode($description), 'description');
             if (!empty($this->pageMeta)) {
                 $keywords = $model->site_keywords . ',' . $this->pageMeta;
             } else {
                 $keywords = $model->site_keywords;
             }
             Yii::app()->clientScript->registerMetaTag(Utility::hardDecode($keywords), 'keywords');
             /**
              * Facebook open graph and all custom metatags
              * @title
              * @description
              * @image
              */
             // title
             Yii::app()->meta->googlePlusTags['name'] = Yii::app()->meta->facebookTags['og:title'] = Yii::app()->meta->twitterTags['twitter:title'] = CHtml::encode($this->pageTitle) . ' | ' . $model->site_title;
             // description
             Yii::app()->meta->googlePlusTags['description'] = Yii::app()->meta->facebookTags['og:description'] = Yii::app()->meta->twitterTags['twitter:description'] = ucfirst(strtolower($description));
             // image
             if (!empty($this->pageImage)) {
                 Yii::app()->meta->facebookTags['og:image'] = Yii::app()->meta->googlePlusTags['image'] = Yii::app()->meta->twitterTags['twitter:image:src'] = Utility::getProtocol() . '://' . Yii::app()->request->serverName . $this->pageImage;
             }
             // language
             $this->lang = Utility::getLanguage();
             Yii::app()->setLanguage($this->lang);
         }
     } else {
         $this->pageDescription = $this->pageDescription != '' ? ucfirst(strtolower($this->pageDescription)) : $model->site_description;
         $this->pageMeta = $this->pageMeta != '' ? $model->site_keywords . ', ' . $this->pageMeta : $model->site_keywords;
     }
     $this->pageTitle = $this->pageTitle != '' ? $this->pageTitle : 'Titlenya Lupa..';
     return true;
 }
 protected function renderContent()
 {
     //get information
     $model = OmmuSettings::model()->findByPk(1, array('select' => 'site_title, site_description'));
     $this->render('footer_copyright', array('model' => $model));
 }
echo Yii::t('phrase', 'Provide some keywords (separated by commas) that describe your community. These will be the default keywords that appear in the <meta> tag in your page header. Enter the most relevant keywords you can think of to help your community\'s search engine rankings.');
?>
</span>
			</label>
			<div class="desc">
				<?php 
echo $form->textArea($model, 'site_keywords', array('rows' => 6, 'cols' => 50, 'class' => 'span-9', 'maxlength' => 256));
?>
				<?php 
echo $form->error($model, 'site_keywords');
?>
			</div>
		</div>

		<?php 
if (OmmuSettings::getInfo('site_type') == 1) {
    ?>
		<div class="clearfix">
			<label>
				<?php 
    echo Yii::t('phrase', 'Public Permission Defaults');
    ?>
				<span><?php 
    echo Yii::t('phrase', 'Select whether or not you want to let the public (visitors that are not logged-in) to view the following sections of your social network. In some cases (such as Profiles), if you have given them the option, your users will be able to make their pages private even though you have made them publically viewable here.');
    ?>
</span>
			</label>
			<div class="desc">
				<p><?php 
    echo $model->getAttributeLabel('general_profile');
    ?>
Example #22
0
if (isset($_GET['protocol']) && $_GET['protocol'] == 'script') {
    echo $cs = Yii::app()->getClientScript()->getScripts();
} else {
    Yii::import('webroot.themes.' . Yii::app()->theme->name . '.components.*');
    Yii::import('webroot.themes.' . Yii::app()->theme->name . '.components.public.*');
    $module = strtolower(Yii::app()->controller->module->id);
    $controller = strtolower(Yii::app()->controller->id);
    $action = strtolower(Yii::app()->controller->action->id);
    $currentAction = strtolower(Yii::app()->controller->id . '/' . Yii::app()->controller->action->id);
    $currentModule = strtolower(Yii::app()->controller->module->id . '/' . Yii::app()->controller->id);
    $currentModuleAction = strtolower(Yii::app()->controller->module->id . '/' . Yii::app()->controller->id . '/' . Yii::app()->controller->action->id);
    /**
     * = Global condition
     ** Construction condition
     */
    $setting = OmmuSettings::model()->findByPk(1, array('select' => 'online, site_type, site_url, site_title, construction_date, signup_inviteonly, general_include'));
    $construction = $setting->online == 0 && date('Y-m-d', strtotime($setting->construction_date)) > date('Y-m-d') && (Yii::app()->user->isGuest || !Yii::app()->user->isGuest && in_array(!Yii::app()->user->level, array(1, 2))) ? 1 : 0;
    /**
     * = Dialog Condition
     * $construction = 1 (construction active)
     */
    if ($construction == 1) {
        $dialogWidth = !empty($this->dialogWidth) ? $this->dialogFixed == false ? $this->dialogWidth . 'px' : '600px' : '900px';
    } else {
        if ($this->dialogDetail == true) {
            $dialogWidth = !empty($this->dialogWidth) ? $this->dialogFixed == false ? $this->dialogWidth . 'px' : '600px' : '700px';
        } else {
            $dialogWidth = '';
        }
    }
    $display = $this->dialogDetail == true && !Yii::app()->request->isAjaxRequest ? 'style="display: block;"' : '';