/** * 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 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'); ?>
/** * Displays the login page */ public function actionLogin() { if (!Yii::app()->user->isGuest) { $this->redirect(array('site/index')); } else { $setting = OmmuSettings::getInfo('site_type'); if ($setting == 1) { $this->redirect(Yii::app()->createUrl('users/account')); } else { $this->redirect(Yii::app()->createUrl('users/admin')); } } }
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>
?> </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');
<?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> </strong><br/>
/** * Return setting template with typePage: public, admin_sweeto or back_office */ public static function getPluginMenu($module = null) { Yii::import('application.components.plugin.Spyc'); define('DS', DIRECTORY_SEPARATOR); if ($module == null) { return false; } else { $pluginMenuPath = Yii::getPathOfAlias('application.modules.' . $module) . DS . $module . '.yaml'; } if (file_exists($pluginMenuPath)) { $arraySpyc = Spyc::YAMLLoad($pluginMenuPath); $pluginMenu = $arraySpyc[plugin_menu]; /* echo '<pre>'; print_r($pluginMenu); echo '</pre>'; exit(); */ if ($pluginMenu != null) { $pluginMenuData = array_filter($pluginMenu, function ($a) { $siteType = explode(',', $a[urlRules][siteType]); $userLevel = explode(',', $a[urlRules][userLevel]); return in_array(OmmuSettings::getInfo('site_type'), $siteType) && in_array(Yii::app()->user->level, $userLevel); }); return $pluginMenuData; } else { return false; } } else { return false; } }
/** * 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(); }