Ejemplo n.º 1
0
 /**
  * Get allowed category ids as array
  * @return array
  */
 public function categoryIds()
 {
     $data = ContentCategory::getSortedCategories();
     return array_keys($data);
 }
Ejemplo n.º 2
0
 /**
  * Get allowed category ids as array (string values for validation)
  * @return array
  */
 public function categoryList()
 {
     $response = ContentCategory::getSortedCategories();
     if ($this->id !== null) {
         unset($response[$this->id]);
     }
     return $response;
 }
Ejemplo n.º 3
0
<?php 
$form = new Form($model, ['class' => 'form-horizontal', 'enctype' => 'multipart/form-data']);
echo $form->start();
?>

<?php 
$items = [];
foreach (\App::$Properties->get('languages') as $lang) {
    $items[] = ['type' => 'tab', 'text' => __('Lang') . ': ' . Str::upperCase($lang), 'content' => $form->field('title.' . $lang, 'text', ['class' => 'form-control'], __('Please, enter the title of your material for current language locale')) . $form->field('text.' . $lang, 'textarea', ['class' => 'form-control wysiwyg', 'rows' => 7, 'html' => true]), 'html' => true, 'active' => $lang === \App::$Request->getLanguage(), '!secure' => true];
}
echo Nav::display(['property' => ['class' => 'nav-pills'], 'blockProperty' => ['class' => 'nav-locale-block'], 'tabAnchor' => 'content-update-general-locale', 'items' => $items]);
?>

<?php 
echo $form->field('path', 'text', ['class' => 'form-control'], __('Set path slug for content item. Allowed items: a-z, 0-9, -'));
echo $form->field('categoryId', 'select', ['class' => 'form-control', 'size' => 4, 'options' => ContentCategory::getSortedCategories(), 'optionsKey' => true], __('Select content category'));
?>

<?php 
echo $form->field('poster', 'file', null, __('Select poster image for this content'));
?>

<div class="col-md-offset-3 col-md-9">
    <?php 
echo $form->submitButton(__('Save'), ['class' => 'btn btn-primary']);
?>
</div>

<?php 
echo $form->finish();
?>
Ejemplo n.º 4
0
 /**
  * Get all categories as sorted array
  * @return array
  */
 public function getCategories()
 {
     return ContentCategory::getSortedCategories();
 }
Ejemplo n.º 5
0
                    <li><?php 
echo Url::link(['content/index', null, null, ['type' => 'moderate']], '<i class="fa fa-exclamation"></i> ' . __('Moderate'));
?>
</li>
                    <li><?php 
echo Url::link(['content/index', null, null, ['type' => 'trash']], '<i class="fa fa-trash"></i> ' . __('Trash'));
?>
</li>
                    <li>
                        <a class="trigger right-caret"><i class="fa fa-table"></i> <?php 
echo __('Categories');
?>
</a>
                        <ul class="dropdown-menu sub-menu">
                            <?php 
foreach (ContentCategory::getSortedCategories() as $id => $name) {
    ?>
                            <li><?php 
    echo Url::link(['content/index', null, null, ['type' => $id]], $name);
    ?>
</li>
                            <?php 
}
?>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <?php 
if ($type === 'trash') {