Beispiel #1
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $setting = ArticleSetting::model()->findByPk(1, array('select' => 'meta_description, meta_keyword'));
     if (isset($_GET['category']) && $_GET['category'] != '') {
         $title = ArticleCategory::model()->findByPk($_GET['category']);
     }
     $criteria = new CDbCriteria();
     $criteria->condition = 'publish = :publish AND published_date <= curdate()';
     $criteria->params = array(':publish' => 1);
     $criteria->order = 'published_date DESC';
     if (isset($_GET['category']) && $_GET['category'] != '') {
         $criteria->compare('cat_id', $_GET['category']);
     }
     $dataProvider = new CActiveDataProvider('Articles', array('criteria' => $criteria, 'pagination' => array('pageSize' => 10)));
     $this->pageTitle = 'Articles';
     $this->pageDescription = isset($_GET['category']) && $_GET['category'] != '' ? Phrase::trans($title->name, 2) : $setting->meta_description;
     $this->pageMeta = isset($_GET['category']) && $_GET['category'] != '' ? Phrase::trans($title->desc, 2) : $setting->meta_keyword;
     $this->render('front_index', array('dataProvider' => $dataProvider));
 }
 /**
  * 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 = SupportContacts::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Phrase::trans(193, 0));
     }
     return $model;
 }
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = $this->loadModel(1);
     $category = new ArticleCategory('search');
     $category->unsetAttributes();
     // clear any default values
     if (isset($_GET['ArticleCategory'])) {
         $category->attributes = $_GET['ArticleCategory'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $category->getGridColumn($columnTemp);
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['ArticleSetting'])) {
         $model->attributes = $_POST['ArticleSetting'];
         $jsonError = CActiveForm::validate($model);
         if (strlen($jsonError) > 2) {
             $errors = $model->getErrors();
             $summary['msg'] = "<div class='errorSummary'><strong>" . Yii::t('phrase', 'Please fix the following input errors:') . "</strong>";
             $summary['msg'] .= "<ul>";
             foreach ($errors as $key => $value) {
                 $summary['msg'] .= "<li>{$value[0]}</li>";
             }
             $summary['msg'] .= "</ul></div>";
             $message = json_decode($jsonError, true);
             $merge = array_merge_recursive($summary, $message);
             $encode = json_encode($merge);
             echo $encode;
         } else {
             if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                 if ($model->update()) {
                     echo CJSON::encode(array('type' => 0, 'msg' => '<div class="errorSummary success"><strong>' . Phrase::trans(26013, 1) . '</strong></div>'));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     }
     $this->pageTitle = Phrase::trans(26001, 1);
     $this->pageDescription = Phrase::trans(26002, 1);
     $this->pageMeta = '';
     $this->render('admin_index', array('model' => $model, 'category' => $category, 'columns' => $columns));
 }
 * @var $this MediaController
 * @var $model ArticleMedia
 * @var $form CActiveForm
 *
 * @author Putra Sudaryanto <*****@*****.**>
 * @copyright Copyright (c) 2012 Ommu Platform (ommu.co)
 * @link https://github.com/oMMu/Ommu-Articles
 * @contact (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Article Medias' => array('manage'), 'Delete');
?>

<?php 
$form = $this->beginWidget('application.components.system.OActiveForm', array('id' => 'article-media-form', 'enableAjaxValidation' => true));
?>
	<div class="dialog-content">
		<?php 
echo Phrase::trans(26107, 1);
?>
	</div>
	<div class="dialog-submit">
		<?php 
echo CHtml::submitButton(Phrase::trans(26106, 1), array('onclick' => 'setEnableSave()'));
?>
		<?php 
echo CHtml::button(Phrase::trans(174, 0), array('id' => 'closed'));
?>
	</div>
<?php 
$this->endWidget();
 /**
  * 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($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['ReportCategory'])) {
         $model->attributes = $_POST['ReportCategory'];
         $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-report-category', 'msg' => '<div class="errorSummary success"><strong>' . Yii::t('phrase', 'Report category success updated.') . '</strong></div>'));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->controller->createUrl('manage');
         $this->dialogWidth = 500;
         $this->pageTitle = Yii::t('phrase', 'Update Report Category') . ': ' . Phrase::trans($model->name, 2);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('admin_edit', array('model' => $model));
     }
 }
 /**
  * Get category
  * 0 = unpublish
  * 1 = publish
  */
 public static function getCategory($publish = null)
 {
     $criteria = new CDbCriteria();
     if ($publish != null) {
         $criteria->compare('t.publish', $publish);
     }
     $model = self::model()->findAll($criteria);
     $items = array();
     if ($model != null) {
         foreach ($model as $key => $val) {
             $items[$val->cat_id] = Phrase::trans($val->name, 2);
         }
         return $items;
     } else {
         return false;
     }
 }
 /**
  * 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 = ArticleMedia::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Phrase::trans(193, 0));
     }
     return $model;
 }
Beispiel #8
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionSend()
 {
     $model = new Reports();
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['Reports'])) {
         $model->attributes = $_POST['Reports'];
         $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('send', array('type' => 'success'))));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->createUrl('site/index');
         $this->dialogWidth = 500;
         $this->pageTitle = Phrase::trans(12014, 1);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('front_send', array('model' => $model));
     }
 }
<?php

if ($model != null) {
    ?>
	<ul>
	<?php 
    echo '<li><a href="' . Yii::app()->controller->createUrl('index') . '" title="' . Yii::t('phrase', 'All') . '">' . Yii::t('phrase', 'All') . '</a></li>';
    foreach ($model as $key => $val) {
        echo '<li><a href="' . Yii::app()->controller->createUrl('index', array('cat' => $val->cat_id, 't' => Utility::getUrlTitle(Phrase::trans($val->name, 2)))) . '" title="' . Phrase::trans($val->name, 2) . '">' . Phrase::trans($val->name, 2) . '</a></li>';
    }
    ?>
	</ul>
<?php 
}
$model->title = Phrase::trans($model->name, 2);
echo $form->textField($model, 'title', array('maxlength' => 32, 'class' => 'span-7'));
?>
				<?php 
echo $form->error($model, 'title');
?>
			</div>
		</div>

		<div class="clearfix">
			<?php 
echo $form->labelEx($model, 'description');
?>
			<div class="desc">
				<?php 
$model->description = Phrase::trans($model->desc, 2);
echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50, 'class' => 'span-9 smaller'));
?>
				<?php 
echo $form->error($model, 'description');
?>
			</div>
		</div>

		<div class="clearfix publish">
			<?php 
echo $form->labelEx($model, 'defaults');
?>
			<div class="desc">
				<?php 
echo $form->checkBox($model, 'defaults');
				<div class="clearfix message">
					<div class="desc">
						<?php 
    echo $form->textArea($model, 'message', array('rows' => 6, 'cols' => 50));
    ?>
						<?php 
    echo $form->error($model, 'message');
    ?>
					</div>
				</div>

				<div class="submit clearfix">
					<label>&nbsp;</label>
					<div class="desc">
						<?php 
    echo CHtml::submitButton($model->isNewRecord ? Phrase::trans(328, 0) : Phrase::trans(328, 0), array('onclick' => 'setEnableSave()'));
    ?>
					</div>
				</div>

			</fieldset>
			<?php 
    $this->endWidget();
    ?>
		</div>
	<?php 
}
?>
	<?php 
//end.Contact Form
?>
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDefault($id)
 {
     $model = $this->loadModel($id);
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (isset($id)) {
             //change value active or publish
             $model->defaults = 1;
             if ($model->update()) {
                 echo CJSON::encode(array('type' => 5, 'get' => Yii::app()->controller->createUrl('manage'), 'id' => 'partial-levels', 'msg' => '<div class="errorSummary success"><strong>' . Phrase::trans(16007, 1) . '</strong></div>'));
             }
         }
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->controller->createUrl('manage');
         $this->dialogWidth = 350;
         $this->pageTitle = Yii::t('phrase', 'Default');
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('admin_default', array('model' => $model));
     }
 }
<?php

echo Phrase::trans(331, 0);
?>
 &copy; <?php 
echo date("Y") > '2016' ? '2016-' . date("Y") : '2016';
?>
 <a href="<?php 
echo Yii::app()->createUrl('site/index');
?>
" title="<?php 
echo $model->site_title;
?>
"> <?php 
echo $model->site_title;
?>
</a>. <?php 
echo Phrase::trans(332, 0);
?>
. <span class="powered"><?php 
echo Phrase::trans(333, 0);
?>
 <a href="http://swevel.com" target="_blank" title="Ommu Platform">Swevel</a> + <a href="http://opensource.ommu.co" target="_blank" title="Ommu Platform">Ommu Platform</a></span>
Beispiel #14
0
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionAjaxCover($id)
 {
     if (!isset($_GET['type'])) {
         $arrThemes = Utility::getCurrentTemplate('public');
         Yii::app()->theme = $arrThemes['folder'];
         $this->layout = $arrThemes['layout'];
         Utility::applyCurrentTheme($this->module);
     }
     $model = $this->loadModel($id);
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (isset($id)) {
             $model->cover = 1;
             if ($model->update()) {
                 $url = Yii::app()->controller->createUrl('ajaxmanage', array('id' => $model->album_id, 'replace' => 'true'));
                 echo CJSON::encode(array('type' => 2, 'id' => 'media-render', 'get' => $url));
             }
         }
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->controller->createUrl('admin/edit', array('id' => $model->album_id));
         $this->dialogWidth = 350;
         $this->pageTitle = Phrase::trans(26105, 1);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('front_cover');
     }
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     $model = $this->loadModel($id);
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (isset($id)) {
             $model->delete();
             if (isset($_GET['type']) && $_GET['type'] == 'article') {
                 echo CJSON::encode(array('type' => 4));
             } else {
                 echo CJSON::encode(array('type' => 5, 'get' => Yii::app()->controller->createUrl('manage'), 'id' => 'partial-article-tag', 'msg' => '<div class="errorSummary success"><strong>' . Phrase::trans(26082, 1) . '</strong></div>'));
             }
         }
     } else {
         $this->dialogDetail = true;
         if (isset($_GET['type']) && $_GET['type'] == 'article') {
             $url = Yii::app()->controller->createUrl('o/admin/edit', array('id' => $model->article_id));
         } else {
             $url = Yii::app()->controller->createUrl('manage');
         }
         $this->dialogGroundUrl = $url;
         $this->dialogWidth = 350;
         $this->pageTitle = Phrase::trans(26081, 1);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('admin_delete');
     }
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         if (isset($id)) {
             $this->loadModel($id)->delete();
             echo CJSON::encode(array('type' => 5, 'get' => Yii::app()->controller->createUrl('manage'), 'id' => 'partial-articles', 'msg' => '<div class="errorSummary success"><strong>' . Phrase::trans(26035, 1) . '</strong></div>'));
         }
     } else {
         $this->dialogDetail = true;
         $this->dialogGroundUrl = Yii::app()->controller->createUrl('manage');
         $this->dialogWidth = 350;
         $this->pageTitle = Phrase::trans(26034, 1);
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('admin_delete');
     }
 }
<div class="boxed mt-15">
	<h3><?php 
    echo Phrase::trans(26053, 1);
    ?>
</h3>
	<div class="clearfix horizontal-data" name="four">
		<ul id="media-render">
			<li id="upload" <?php 
    echo count(ArticleMedia::getPhoto($model->article_id)) == $setting->media_limit ? 'class="hide"' : '';
    ?>
>
				<a id="upload-gallery" href="<?php 
    echo Yii::app()->controller->createUrl('o/media/ajaxadd', array('id' => $model->article_id, 'type' => 'admin'));
    ?>
" title="<?php 
    echo Phrase::trans(26054, 1);
    ?>
"><?php 
    echo Phrase::trans(26054, 1);
    ?>
</a>
				<img src="<?php 
    echo Utility::getTimThumb(Yii::app()->request->baseUrl . '/public/article/article_default.png', 320, 250, 1);
    ?>
" alt="" />
			</li>
		</ul>
	</div>
</div>
<?php 
}
<?php

/**
 * Banners (banners)
 * @var $this AdminController
 * @var $model Banners
 *
 * @author Putra Sudaryanto <*****@*****.**>
 * @copyright Copyright (c) 2014 Ommu Platform (ommu.co)
 * @link https://github.com/oMMu/Ommu-Banner
 * @contect (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('Banners' => array('manage'), $model->title);
?>

<div class="box">
	<?php 
$this->widget('application.components.system.FDetailView', array('data' => $model, 'attributes' => array(array('name' => 'cat_id', 'value' => Phrase::trans($model->category_relation->name, 2)), 'title', array('name' => 'url', 'value' => CHtml::link($model->url, $model->url, array('target' => '_blank')), 'type' => 'raw'), array('name' => 'url', 'value' => CHtml::link($model->media, Yii::app()->request->baseUrl . '/public/banner/' . $model->media, array('target' => '_blank')), 'type' => 'raw'), array('name' => 'published_date', 'value' => Utility::dateFormat($model->published_date)), array('name' => 'expired_date', 'value' => Utility::dateFormat($model->expired_date)), 'view', 'click', array('name' => 'creation_date', 'value' => Utility::dateFormat($model->creation_date, true)), array('name' => 'creation_id', 'value' => $model->creation_relation->displayname), array('name' => 'modified_date', 'value' => Utility::dateFormat($model->modified_date, true)), array('name' => 'modified_id', 'value' => $model->modified_relation->displayname), array('name' => 'publish', 'value' => $model->publish == 1 ? Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/publish.png') : Chtml::image(Yii::app()->theme->baseUrl . '/images/icons/unpublish.png'), 'type' => 'raw'))));
?>
</div>
 /**
  * Set default columns to display
  */
 protected function afterConstruct()
 {
     if (count($this->defaultColumns) == 0) {
         $this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
         $this->defaultColumns[] = array('name' => 'user_search', 'value' => '$data->newsletter->user_id != 0 ? $data->newsletter->user->displayname : "-"');
         $this->defaultColumns[] = array('name' => 'email_search', 'value' => '$data->newsletter->email');
         $this->defaultColumns[] = array('name' => 'status', 'value' => '$data->status == 1 ? Phrase::trans(23057,1) : Phrase::trans(16256,1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Phrase::trans(23057, 1), 0 => Phrase::trans(16256, 1)), 'type' => 'raw');
         $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));
     }
     parent::afterConstruct();
 }
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id = null, $static = null)
 {
     $arrThemes = Utility::getCurrentTemplate('public');
     Yii::app()->theme = $arrThemes['folder'];
     $this->layout = $arrThemes['layout'];
     Utility::applyCurrentTheme($this->module);
     //$this->pageGuest = true;
     if ($id == null) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'publish = :publish';
         $criteria->params = array(':publish' => 1);
         $criteria->order = 'creation_date DESC';
         $dataProvider = new CActiveDataProvider('OmmuPages', array('criteria' => $criteria, 'pagination' => array('pageSize' => 10)));
         $this->pageTitle = '';
         $this->pageDescription = '';
         $this->pageMeta = '';
         $this->render('application.webs.page.front_index', array('dataProvider' => $dataProvider));
     } else {
         if ($static == null) {
             $model = $this->loadModel($id);
             $title = Phrase::trans($model->name, 2);
             $description = Phrase::trans($model->desc, 2);
             $image = $model->media != '' && $model->media_show == 1 ? Yii::app()->request->baseUrl . '/public/page/' . $model->media : '';
         } else {
             $server = Utility::getConnected(Yii::app()->params['server_options']['bpad']);
             if ($server != 'neither-connected') {
                 if (in_array($server, Yii::app()->params['server_options']['localhost'])) {
                     $server = $server . '/bpadportal';
                 }
                 $url = $server . preg_replace('(' . Yii::app()->request->baseUrl . ')', '', Yii::app()->createUrl('api/page/detail'));
                 $item = array('id' => $id);
                 $items = http_build_query($item);
                 $ch = curl_init();
                 curl_setopt($ch, CURLOPT_URL, $url);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                 //curl_setopt($ch,CURLOPT_HEADER, true);
                 curl_setopt($ch, CURLOPT_POST, true);
                 curl_setopt($ch, CURLOPT_POSTFIELDS, $items);
                 $output = curl_exec($ch);
                 $model = json_decode($output);
             }
             $title = $model->success == '0' ? 'Page not found' : $model->title;
             $description = $model->success == '0' ? '' : $model->description;
             $image = $model->success == '0' ? '' : $model->media_image != '-' ? $model->media_image : '';
         }
         if ($static == null && $model == null || $static != null && $model->success == '0') {
             throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
         }
         $this->pageTitleShow = true;
         $this->pageTitle = $title;
         $this->pageDescription = Utility::shortText(Utility::hardDecode($description), 200);
         $this->pageMeta = '';
         $this->pageImage = $image;
         $this->render('application.webs.page.front_view', array('model' => $model, 'a' => $static));
     }
 }
 /**
  * @return array customized attribute labels (name=>label)
  */
 public function attributeLabels()
 {
     return array('id' => Phrase::trans(26080, 1), 'article_id' => Phrase::trans(26000, 1), 'tag_id' => Phrase::trans(26080, 1), 'article_search' => Phrase::trans(26000, 1), 'tag_search' => Phrase::trans(26080, 1), 'creation_date' => Phrase::trans(26069, 1), 'creation_search' => 'Creation');
 }
 /**
  * before save attributes
  */
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         $action = strtolower(Yii::app()->controller->action->id);
         $location = strtolower(Yii::app()->controller->id);
         if ($this->isNewRecord) {
             $title = new OmmuSystemPhrase();
             $title->location = $location . '_title';
             $title->en_us = $this->title;
             if ($title->save()) {
                 $this->name = $title->phrase_id;
             }
             $desc = new OmmuSystemPhrase();
             $desc->location = $location . '_description';
             $desc->en_us = $this->description;
             if ($desc->save()) {
                 $this->desc = $desc->phrase_id;
             }
             $quote = new OmmuSystemPhrase();
             $quote->location = $location . '_quotes';
             $quote->en_us = $this->quotes;
             if ($quote->save()) {
                 $this->quote = $quote->phrase_id;
             }
         } else {
             $title = OmmuSystemPhrase::model()->findByPk($this->name);
             $title->en_us = $this->title;
             $title->save();
             $desc = OmmuSystemPhrase::model()->findByPk($this->desc);
             $desc->en_us = $this->description;
             $desc->save();
             if ($this->quote != 0) {
                 $quote = OmmuSystemPhrase::model()->findByPk($this->quote);
                 $quote->en_us = $this->quotes;
                 $quote->save();
             } else {
                 $quote = new OmmuSystemPhrase();
                 $quote->location = $location . '_quotes';
                 $quote->en_us = $this->quotes;
                 if ($quote->save()) {
                     $this->quote = $quote->phrase_id;
                 }
             }
         }
         //upload new photo
         if (in_array($action, array('add', 'edit'))) {
             $page_path = "public/page";
             $this->media = CUploadedFile::getInstance($this, 'media');
             if ($this->media instanceof CUploadedFile) {
                 $fileName = time() . '_' . Utility::getUrlTitle(Phrase::trans($this->name, 2)) . '.' . strtolower($this->media->extensionName);
                 if ($this->media->saveAs($page_path . '/' . $fileName)) {
                     //create thumb image
                     Yii::import('ext.phpthumb.PhpThumbFactory');
                     $pageImg = PhpThumbFactory::create($page_path . '/' . $fileName, array('jpegQuality' => 90, 'correctPermissions' => true));
                     $pageImg->resize(700);
                     if ($pageImg->save($page_path . '/' . $fileName)) {
                         $this->media_show = 1;
                         $this->media_type = 1;
                     }
                     if (!$this->isNewRecord && $this->old_media != '' && file_exists($page_path . '/' . $this->old_media)) {
                         rename($page_path . '/' . $this->old_media, 'public/page/verwijderen/' . $this->page_id . '_' . $this->old_media);
                     }
                     $this->media = $fileName;
                 }
             }
             if (!$this->isNewRecord && $this->media == '') {
                 $this->media = $this->old_media;
             }
         }
     }
     return true;
 }
 /**
  * before validate attributes
  */
 protected function beforeValidate()
 {
     $module = strtolower(Yii::app()->controller->module->id);
     $controller = strtolower(Yii::app()->controller->id);
     if (parent::beforeValidate()) {
         if ($this->email != '') {
             $model = UserInviteQueue::model()->findByAttributes(array('email' => strtolower($this->email)), array('select' => 'queue_id, member_id, invite'));
             if ($model == null) {
                 // email belum masuk daftar invite
                 $invite = new UserInviteQueue();
                 $invite->email = $this->email;
                 if ($invite->save()) {
                     $this->queue_id = $invite->queue_id;
                 }
             } else {
                 // email sudah dalam daftar invite
                 if ($module != null && $module == 'users' && $controller == 'invite') {
                     if ($model->member_id != 0) {
                         // email sudah menjadi member
                         $this->addError('email', Phrase::trans(16213, 1));
                     } else {
                         // email belum menjadi member
                         $invite = self::model()->with('queue')->find(array('select' => 'invite_id', 'condition' => 'queue.email = :email AND t.user_id = :user', 'params' => array(':email' => strtolower($this->email), ':user' => Yii::app()->user->id)));
                         if ($invite == null) {
                             $this->queue_id = $model->queue_id;
                         } else {
                             // email sudah invite sebelumnya
                             $this->addError('email', Phrase::trans(16212, 1));
                         }
                     }
                 }
             }
         }
         if ($this->isNewRecord) {
             $this->user_id = Yii::app()->user->id;
             $this->code = self::getUniqueCode();
             $this->invite_ip = $_SERVER['REMOTE_ADDR'];
         }
     }
     return true;
 }
		<div class="clear">
			<div class="left">
				<div class="clearfix" id="type">
					<?php 
echo $model->isNewRecord ? $form->labelEx($model, 'article_type') : '<label>' . $model->getAttributeLabel('article_type') . '</label>';
?>
					<div class="desc">
						<?php 
if ($model->isNewRecord) {
    $arrAttrParams = array();
    if ($setting->type_active != '') {
        $arrAttr = explode(',', $setting->type_active);
        if (count($arrAttr) > 0) {
            foreach ($arrAttr as $row) {
                $part = explode('=', $row);
                $arrAttrParams[$part[0]] = Phrase::trans($part[1], 1);
            }
        }
    }
    echo $form->dropDownList($model, 'article_type', $arrAttrParams);
    //echo $form->dropDownList($model,'article_type', $arrAttrParams, array('prompt'=>Yii::t('phrase', 'Choose one')));
} else {
    if ($model->article_type == 1) {
        echo '<strong>' . Yii::t('phrase', 'Standard') . '</strong>';
    } elseif ($model->article_type == 2) {
        echo '<strong>' . Yii::t('phrase', 'Video') . '</strong>';
    } elseif ($model->article_type == 4) {
        echo '<strong>' . Yii::t('phrase', 'Quote') . '</strong>';
    }
}
?>
<?php

if ($model->media != '') {
    $images = Yii::app()->request->baseUrl . '/public/page/' . $model->media;
} else {
    $images = Yii::app()->request->baseUrl . '/public/page/page_default.png';
}
?>
<div class="clearfix">
	<div class="sep">
		<img src="<?php 
echo Utility::getTimThumb($images, 300, 300, 1);
?>
" alt="<?php 
echo Phrase::trans($model->name, 2);
?>
">
		<?php 
echo Phrase::trans($model->quote, 2);
?>
	</div>
	<div class="sep"><?php 
echo Phrase::trans($model->name, 2) != Utility::hardDecode(Phrase::trans($model->desc, 2)) ? Utility::cleanImageContent(Phrase::trans($model->desc, 2)) : '';
?>
</div>
</div>
 *
 */
?>

<?php 
$form = $this->beginWidget('application.components.system.OActiveForm', array('id' => 'users-form', 'enableAjaxValidation' => true));
?>
<div class="dialog-content">
	<fieldset>

		<?php 
if (isset($_GET['id'])) {
    ?>
		<div class="intro">
			<?php 
    echo Phrase::trans(16104, 1);
    ?>
		</div>
		<?php 
}
?>

		<?php 
//begin.Messages
?>
		<div id="ajax-message">
			<?php 
echo $form->errorSummary($model);
?>
		</div>
		<?php 
<?php

/**
 * User Forgot (user-forgot)
 * @var $this ForgotController
 * @var $model UserForgot
 * @var $form CActiveForm
 *
 * @author Putra Sudaryanto <*****@*****.**>
 * @copyright Copyright (c) 2012 Ommu Platform (ommu.co)
 * @link https://github.com/oMMu/Ommu-Users
 * @contact (+62)856-299-4114
 *
 */
$this->breadcrumbs = array('User Forgots' => array('manage'), 'Create');
if (isset($_GET['name']) && isset($_GET['email'])) {
    if (isset($_GET['type']) && $_GET['type'] == 'success') {
        echo '<a class="button" href="' . Yii::app()->createUrl('site/login') . '" title="' . Phrase::trans(1006, 2) . '">' . Phrase::trans(1006, 2) . '</a>';
    }
} else {
    echo $this->renderPartial('_form', array('model' => $model));
}
 */
?>

<?php 
$form = $this->beginWidget('application.components.system.OActiveForm', array('id' => 'user-forgot-form', 'enableAjaxValidation' => true));
?>
	<fieldset class="users-forgot">
		<div class="clearfix">
			<?php 
echo $form->labelEx($model, 'email');
?>
			<div class="desc">
				<?php 
echo $form->textField($model, 'email', array('maxlength' => 32, 'placeholder' => $model->getAttributeLabel('email')));
?>
				<?php 
echo $form->error($model, 'email');
?>
			</div>
		</div>
		<div class="clearfix">
			<label></label>
			<div class="desc">
				<?php 
echo CHtml::submitButton(Phrase::trans(16228, 1), array('onclick' => 'setEnableSave()', 'class' => 'blue-button'));
?>
			</div>
		</div>
	</fieldset>
<?php 
$this->endWidget();
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionGet()
 {
     $model = new UserForgot();
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['UserForgot'])) {
         $model->attributes = $_POST['UserForgot'];
         $model->scenario = 'get';
         $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('get', array('name' => urlencode($model->user->displayname), 'email' => $model->user->email))));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     }
     if (isset($_GET['name']) && isset($_GET['email'])) {
         if (isset($_GET['type']) && $_GET['type'] == 'success') {
             $desc = Phrase::trans(16191, 1);
         } else {
             $desc = Phrase::trans(16187, 1, array($_GET['name'], $_GET['email']));
         }
     } else {
         $desc = Phrase::trans(16185, 1);
     }
     $this->dialogDetail = true;
     $this->dialogGroundUrl = Yii::app()->createUrl('site/index');
     $this->pageTitle = Phrase::trans(16184, 1);
     $this->pageDescription = $desc;
     $this->pageMeta = '';
     $this->render('front_get', array('model' => $model));
 }
			HP : 0815 - 7808 - 2241<br/>
			Email : <a href="mailto:indha.lesmanawati@ugm.ac.id" title="*****@*****.**">indha.lesmanawati@ugm.ac.id</a>
		</div>
		<?php 
if ($SosMed != null) {
    ?>
			<div class="box social-media">
				<strong>Sosial Media</strong>
				<?php 
    foreach ($SosMed as $key => $val) {
        if ($val->cat->icons == '') {
            $images = Yii::app()->request->baseUrl . '/public/support/default.png';
        } else {
            $images = Yii::app()->request->baseUrl . '/public/support/' . $val->cat->icons;
        }
        if ($val->cat_id == '10') {
            $url = 'ymsgr:sendim?' . $val->value;
            $target = '';
        } else {
            $url = $val->value;
            $target = 'target="_blank"';
        }
        echo '<a href="' . $url . '" title="' . Phrase::trans($val->cat->name, 2) . '" ' . $target . '><img src="' . $images . '" alt="' . Phrase::trans($val->cat->name, 2) . '"></a>';
    }
    ?>
			</div>
		<?php 
}
?>
	</div>
</div>