示例#1
0
 /**
  * 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 $id the ID of the model to be loaded
  * @return Modals the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Modals::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#2
0
    $oModal->displayRestoreBox($sType, new $sBrickClass($sPage, $sRef, $utils->globals->session('lang', $utils->getDefaultLanguage())));
});
$wout->post('/ajax/sitemap.html', 'ajax_admin_middleware', function () use($wout, $utils) {
    $oModal = new Modals();
    $aPages = $utils->getPages();
    $oModal->setTitle("Édition des pages du site", "sitemap-image");
    $oModal->displaySitemapBox($aPages);
});
$wout->post('/ajax/sitemap.order.html', 'ajax_admin_middleware', function () use($wout, $utils) {
    $utils->data->set(':sitemap', $utils->globals->post('order'));
    die($utils->data->save());
});
$wout->post('/ajax/list.manager.html', 'ajax_admin_middleware', function () use($wout, $utils) {
    $oListBrick = new ListBrick($utils->globals->post('page'), $utils->globals->post('list'), $utils->getDefaultLanguage());
    $oModal = new Modals();
    $oModal->setTitle("Gestion de la liste", "category");
    $oModal->displayListManagerBox($utils->globals->post('list'), $oListBrick);
});
$wout->post('/ajax/list/:ref/list.order.html', 'ajax_admin_middleware', function ($sListRef) use($wout, $utils) {
    $oListBrick = new ListBrick($utils->globals->post('page'), $sListRef, $utils->getDefaultLanguage());
    $oListBrick->content = $utils->globals->post('order');
    die($oListBrick->save());
});
$wout->post('/ajax/about.html', 'ajax_admin_middleware', function () use($wout, $utils) {
    $oBranding = Branding::getInstance();
    $oBranding->brand = $utils->data->get(':config:brand', Branding::BRAND_POSIB);
    $sChangelog = file_get_contents(POSIB . 'changelog.inc');
    $oModal = new Modals();
    $oModal->setTitle("À propos de...", 'infocard');
    $oModal->displayAboutBox($oBranding, $sChangelog);
});
示例#3
0
 public function actionGetModal()
 {
     if (isset($_POST)) {
         if ($_POST['username'] == 'online') {
             $model = Modals::model()->findByPk(2);
             $array = Yii::app()->language == 'ru' ? array('title' => $model->title_ru, 'text' => $model->description_ru) : array('title' => $model->title_uk, 'text' => $model->description_uk);
             $array['TextareaFiled'] = Yii::app()->language == 'ru' ? 'Ваш вопрос' : 'Ваше питання';
             echo json_encode($array);
             Yii::app()->end();
         } else {
             $model = Modals::model()->findByPk(1);
             $array = Yii::app()->language == 'ru' ? array('title' => $model->title_ru, 'text' => $model->description_ru) : array('title' => $model->title_uk, 'text' => $model->description_uk);
             $array['TextareaFiled'] = Yii::app()->language == 'ru' ? 'Комментарий' : 'Коментар';
             echo json_encode($array);
             Yii::app()->end();
         }
     }
 }