Ejemplo n.º 1
0

<h1><?php 
echo $model->title;
?>
 (<?php 
echo $model->count;
?>
)</h1>

<?php 
$this->renderPartial('_tree', array('items' => $model->tree[0]->children, 'depth' => 0));
if (count($model->allBusinesses)) {
    ?>
    <h2><?php 
    echo Yii::t('app', Awecms::pluralize('Business', 'Businesses', $model->allBusinesses));
    ?>
:</h2>
    <ul>
        <?php 
    if (is_array($model->allBusinesses)) {
        foreach ($model->allBusinesses as $foreignobj) {
            echo '<li>';
            echo CHtml::link($foreignobj[0]->title, array('/directory/business/view', 'id' => $foreignobj[0]->id));
            echo '</li>';
        }
    }
    ?>
    </ul>
<?php 
}
Ejemplo n.º 2
0
<?php

$this->breadcrumbs = array(Yii::t('app', 'Albums') => array('/gallery'), Yii::t('app', $model->page->title));
if (!isset($this->menu) || $this->menu === array()) {
    $this->menu = array(array('label' => Yii::t('app', 'View album')), array('label' => Yii::t('app', 'Edit this album'), 'url' => array('/gallery/album/update', 'id' => $model->id)), array('label' => Yii::t('app', 'Upload images'), 'url' => array('/gallery/album/upload', 'id' => $model->id)), array('label' => Yii::t('app', 'Delete this album'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => Yii::t('app', 'List all albums'), 'url' => array('/gallery/album')), array('label' => Yii::t('app', 'Create new album'), 'url' => array('/gallery/album/create')), array('label' => Yii::t('app', 'Manage all abums'), 'url' => array('/gallery/album/manage')), array('label' => Yii::t('app', 'All images'), 'url' => array('/gallery/image')));
}
?>
    <h1 class="inline" itemprop="name"><?php 
echo $model->page->title;
?>
</h1> (<?php 
echo count($images) . ' ' . Awecms::pluralize(Yii::t('app', 'image'), Yii::t('app', 'images'), count($images));
?>
) 

    <?php 
if ($model->page->content) {
    ?>
        <div class="album-desc" itemprop="description">
            <?php 
    echo $model->page->content;
    ?>
        </div>
        <?php 
} else {
    echo "<br>";
}
?>


    <?php 
Ejemplo n.º 3
0
    public function run()
    {
        $page = $this->page;
        foreach ($this->fields as $field) {
            switch ($field) {
                case 'title':
                    ?>
                <h1 itemprop="headline"><?php 
                    echo $page->title;
                    ?>
</h1>
                <?php 
                    break;
                case 'content':
                    echo '<div class="rte-text" itemprop="articleBody">' . $page->content . "</div>";
                    break;
                case 'created_at':
                    echo '<div class="post-time">' . Yii::t('app', 'Posted on ') . '<span itemprop="datePublished">' . date('F d, Y h:m A', strtotime($page->created_at)) . "</span></div>";
                    break;
                case 'excerpt':
                    if (!empty($page->content)) {
                        ?>
                    <div class="field">
                        <div class="field_value">
                            <?php 
                        echo $page->getExcerpt();
                        ?>
                        </div>
                    </div>
                    <?php 
                    }
                    break;
                case 'sub-pages':
                    if (count($page->pages)) {
                        ?>
                    <h2><?php 
                        echo CHtml::link(Yii::t('app', Awecms::pluralize('Sub-Page', 'Sub-Pages', count($page->pages))), array('/page/page'));
                        ?>
</h2>
                    <ul class="sub_pages">
                        <?php 
                        if (is_array($page->pages)) {
                            foreach ($page->pages as $foreignobj) {
                                echo '<li>';
                                echo CHtml::link($foreignobj->title, array('/page/page/view', 'id' => $foreignobj->id));
                            }
                        }
                        ?>
                        </ul>
                        <?php 
                    }
                    break;
                case 'categories':
                    if (Yii::app()->hasModule('category') && count($page->categories)) {
                        ?>
                        <h2><?php 
                        echo CHtml::link(Yii::t('app', Awecms::pluralize('Category', 'Categories', count($page->categories))), array('/category/category'));
                        ?>
</h2>
                        <ul class="categories">
                            <?php 
                        if (is_array($page->categories)) {
                            foreach ($page->categories as $foreignobj) {
                                echo '<li>
                                    <a href="' . Yii::app()->createUrl('/category/category/view', array('id' => $foreignobj->id)) . '">
                                    <span itemprop="articleSection">' . $foreignobj->name . '</span>
                                    </a>
                                    </li>';
                            }
                        }
                        ?>
                            </ul>
                            <?php 
                    }
                    break;
                case 'views':
                    if (!empty($page->views)) {
                        ?>
                            <div class="field">
                                <?php 
                        echo CHtml::encode($page->getAttributeLabel('views'));
                        ?>
:
                                <?php 
                        echo $page->views;
                        ?>
                            </div>
                            <?php 
                    }
                    break;
                case 'tags':
                    if (Yii::app()->hasModule('tag')) {
                        $tags = $page->getTags();
                        if (!empty($tags)) {
                            ?>
                                <div class="field">
                                    <div class="field-name"><?php 
                            echo Yii::t('app', 'Tags');
                            ?>
:</div>
                                    <div class="field-value">
                                        <?php 
                            echo '<span class="tags" itemprop="keywords">' . implode(', ', $tags) . '</span>';
                            ?>
                                    </div>
                                </div>
                                <?php 
                        }
                    }
                    break;
                default:
                    break;
            }
        }
    }
Ejemplo n.º 4
0
}
if (isset($model->address)) {
    echo '<b>' . Yii::t('app', 'Address') . '</b>:<br/>' . nl2br($model->address) . '<br/>';
}
if (isset($model->district_id)) {
    echo '<b>' . Yii::t('app', 'District') . '</b>: ' . $model->district . '<br/>';
}
?>

<div class="rte-text">
    <?php 
echo $model->description;
?>
</div>

<?php 
if (count($model->businessCategories)) {
    ?>
    <h3><?php 
    echo Yii::t('app', Awecms::pluralize('Category', 'Categories', $model->businessCategories));
    ?>
:</h3>
    <?php 
    if (is_array($model->businessCategories)) {
        foreach ($model->businessCategories as $foreignobj) {
            echo '<div class="left">';
            echo CHtml::link($foreignobj->title, array('/directory/categories/view', 'id' => $foreignobj->id));
            echo '</div>';
        }
    }
}