Exemple #1
0
 public function actionIndex()
 {
     $blogPost = BlogPost::model();
     if (!UserAccess::canEditOtherArticles()) {
         $blogPost->author_id = WebApp::get()->user()->id;
     }
     $this->assign('model', BlogPost::model()->setAttributes(isset($_GET['BlogPost']) ? $_GET['BlogPost'] : []));
 }
Exemple #2
0
            </div>
        </div>
    <?php 
}
?>

    <?php 
if (\mpf\modules\blog\components\BlogConfig::get()->showSideCategories) {
    ?>
        <div class="blog-side-section">
            <h2 class="blog-side-section-title">
                <?php 
    echo \app\components\htmltools\Translator::get()->t('Categories');
    ?>
                <?php 
    if (\mpf\modules\blog\components\UserAccess::canEditCategories()) {
        ?>
                    <?php 
        echo \mpf\web\helpers\Html::get()->link(['categories', 'index'], \mpf\web\helpers\Html::get()->mpfImage('oxygen/22x22/actions/configure.png', \app\components\htmltools\Translator::get()->t('Manage Categories')), ['class' => 'blog-manage-categories-link', 'title' => \app\components\htmltools\Translator::get()->t('Manage Categories')]);
        ?>
                <?php 
    }
    ?>
            </h2>
            <div class="blog-side-section-content">
                <ul class="blog-categories-list">
                    <?php 
    foreach (\mpf\modules\blog\models\BlogCategory::findAll() as $category) {
        ?>
                        <li>
                            <?php