Exemplo n.º 1
0
 public function actionFooter()
 {
     $this->breadcrumbs = array_merge($this->breadcrumbs, array('Нижнее меню'));
     $this->pageTitle = 'Нижнее меню';
     $criteria = new CDbCriteria();
     $criteria->condition = 'location=:location';
     $criteria->params = array('location' => 'footer');
     $criteria->order = 'sort_order';
     $models = Navigation::model()->findAll($criteria);
     $this->render('footer', array('models' => $models));
 }
Exemplo n.º 2
0
    public function run()
    {
        $criteria = new CDbCriteria();
        
        $criteria->condition = 'location=:location AND is_visible=:is_visible';
        $criteria->params = array(
            'location'=>$this->location,
            'is_visible'=>(int)TRUE,
        );
        $criteria->order = 'sort_order';

        $navigations = Navigation::model()->findAll($criteria);

        echo $this->render($this->template, array('navigations' => $navigations), true);
    }
Exemplo n.º 3
0
 public function actionShowpage()
 {
     $url = Yii::app()->request->requestUri;
     //var_dump($url);die;
     $currentUrl = Navigation::model()->find('url=:url', array(':url' => $url));
     //var_dump($currentUrl);die;
     //var_dump($currentUrl->object_id);die;
     if ($currentUrl == NULL) {
         throw new CHttpException(404, Yii::t('yii', 'Unable to resolve the request "{route}".', array('{route}' => $url === '' ? $this->defaultController : $url)));
     }
     $page = Pages::model()->findByPk($currentUrl->object_id);
     if ($page == NULL) {
         throw new CHttpException(404, Yii::t('yii', 'Unable to resolve the request "{route}".', array('{route}' => $url === '' ? $this->defaultController : $url)));
     }
     //var_dump($page);die;
     $this->pageTitle = $page->lang->title;
     $this->data_global['page'] = $page;
     $this->layout = $this->layouts_path . $page->layout;
     $this->render('showpage', array('page' => $page));
 }
 public function actionVideo()
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("t.navigationCategories=3");
     $criteria->addCondition("t.active=1");
     $criteria->addCondition("t.delete=0");
     $criteria->order = "t.order, t.id DESC";
     $count = Navigation::model()->count($criteria);
     $pages = new CPagination($count);
     // results per page
     $pages->pageSize = Config::model()->getValueByKey('rowsperpageproduct');
     $pages->applyLimit($criteria);
     $models = Navigation::model()->findAll($criteria);
     $this->pageTitle = 'Học Guitar Online - ' . Config::model()->getValueByKey('sitetitle');
     $this->metaDescription = Config::model()->getValueByKey('metadescription');
     $this->metaKeywords = Config::model()->getValueByKey('metakeywords');
     $this->render('video', array('models' => $models, 'pages' => $pages));
 }
<?php

$video = Navigation::model()->find('t.navigationCategories=3 AND t.active=1 AND t.delete=0 ORDER BY t.order, t.id DESC');
?>
<div id="video" class="box corner">
    <div class="head"><?php 
echo Yii::t('site', 'Video');
?>
</div>
    <div class="box-content corner-bottom-left corner-bottom-right">
    <?php 
if (isset($video)) {
    ?>
    <iframe width="100%" height="170" src="<?php 
    echo $video->link;
    ?>
" frameborder="0" allowfullscreen></iframe>
    <?php 
}
?>
    </div>
</div>
<?php

$partners = Navigation::model()->findAll('t.navigationCategories = 4 AND t.active=1 AND t.delete=0 ORDER BY t.order');
?>
<div id="partners" class="corner">
    <ul id="ulPartners" class="jcarousel jcarousel-skin-tango">
		<?php 
foreach ($partners as $item) {
    ?>
        <?php 
    $thumbnail = isset($item->media[0]) ? $item->media[0]->getURL() : '';
    ?>
        <?php 
    if ($thumbnail != '') {
        ?>
        <li>
            <a href="<?php 
        echo $item->link;
        ?>
" title="<?php 
        echo $item->name;
        ?>
">
                <img alt="<?php 
        echo $item->name;
        ?>
" src="<?php 
        echo $thumbnail;
        ?>
" />
            </a>
<?php

$slideshow = Navigation::model()->findAll('t.navigationCategories = 2 AND t.active=1 AND t.delete=0 ORDER BY t.order');
?>
<!-- Slideshow -->
<div style="max-width: 1000px;" class="metaslider metaslider-flex ml-slider nav-hidden">
	<div>
		<div class="flexslider">
			<ul class="slides">
				<?php 
foreach ($slideshow as $item) {
    ?>
				<?php 
    $thumbnail = isset($item->media[0]) ? $item->media[0]->getURL() : '';
    ?>
				<?php 
    if ($thumbnail != '') {
        ?>
				<li>
					<a href="<?php 
        echo $item->link;
        ?>
" title="<?php 
        echo $item->name;
        ?>
">
						<img alt="<?php 
        echo $item->name;
        ?>
" src="<?php 
        echo $thumbnail;
 /**
  * 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 Navigation the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Navigation::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }