Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // get model
     $model = $this->getModel();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // set titles
     $this->setTitle(Yii::t('kalibao.backend', 'message_message_list_title'));
     $gridHeadAttributes = ['source' => true, 'message_group_i18n_title' => true];
     $languageLabels = [];
     foreach ($this->languageGroupLanguages as $language) {
         if (isset($language->languageI18ns[0])) {
             $languageLabels[$language->language_id] = Html::labelI18n($language->language_id);
         }
     }
     $headFilters = [new InputField(['model' => $model, 'attribute' => 'source', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'placeholder' => Yii::t('kalibao', 'input_search')]]), new InputField(['model' => $model, 'attribute' => 'message_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'message_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($model->message_group_id) ? $this->messageGroups[$model->message_group_id]->name : '']])];
     $advancedHeadFilters = [new InputField(['model' => $model, 'attribute' => 'id', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'placeholder' => Yii::t('kalibao', 'input_search')]]), new InputField(['model' => $model, 'attribute' => 'source', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'placeholder' => Yii::t('kalibao', 'input_search')]]), new InputField(['model' => $model, 'attribute' => 'message_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'message_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($model->message_group_id) ? $this->messageGroups[$model->message_group_id]->title : '']])];
     $languageLabels = $this->orderLanguage($languageLabels);
     foreach ($languageLabels as $languageId => $attribute) {
         $gridHeadAttributes[] = $attribute;
         $headFilters[] = new InputField(['model' => $model, 'attribute' => 'message_i18n_translation[' . $languageId . ']', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'placeholder' => Yii::t('kalibao', 'input_search'), 'name' => (new \ReflectionClass($model))->getShortName() . '[message_i18n_translation][' . $languageId . ']']]);
         $advancedHeadFilters[] = new InputField(['model' => $model, 'attribute' => 'message_i18n_translation[' . $languageId . ']', 'type' => 'activeTextInput', 'label' => Html::labelI18n($languageId), 'options' => ['class' => 'form-control input-sm', 'placeholder' => Yii::t('kalibao', 'input_search'), 'name' => (new \ReflectionClass($model))->getShortName() . '[message_i18n_translation][' . $languageId . ']']]);
     }
     $advancedHeadFilters[] = new DateRangeField(['model' => $model, 'attribute' => 'created_at', 'start' => new InputField(['model' => $model, 'attribute' => 'created_at_start', 'type' => 'activeTextInput', 'options' => ['placeholder' => Yii::t('kalibao', 'input_search'), 'maxlength' => true, 'class' => 'form-control input-sm date-picker date-range']]), 'end' => new InputField(['model' => $model, 'attribute' => 'created_at_end', 'type' => 'activeTextInput', 'options' => ['placeholder' => Yii::t('kalibao', 'input_search'), 'maxlength' => true, 'class' => 'form-control input-sm date-picker date-range']])]);
     $advancedHeadFilters[] = new DateRangeField(['model' => $model, 'attribute' => 'updated_at', 'start' => new InputField(['model' => $model, 'attribute' => 'updated_at_start', 'type' => 'activeTextInput', 'options' => ['placeholder' => Yii::t('kalibao', 'input_search'), 'maxlength' => true, 'class' => 'form-control input-sm date-picker date-range']]), 'end' => new InputField(['model' => $model, 'attribute' => 'updated_at_end', 'type' => 'activeTextInput', 'options' => ['placeholder' => Yii::t('kalibao', 'input_search'), 'maxlength' => true, 'class' => 'form-control input-sm date-picker date-range']])]);
     // set head attributes
     $this->setGridHeadAttributes($gridHeadAttributes);
     // set head filters
     $this->setGridHeadFilters($headFilters);
     // set advanced filters
     $this->setAdvancedFilters($advancedHeadFilters);
 }
Ejemplo n.º 2
0
 /**
  * creates a correct field depending on the file type :
  * if the file is a picture, it will be displayed
  * if the file is anything else, a link to the resource will be displayed.
  *
  * @param $file string file to put in the row
  * @return string the file field
  */
 public function fileField($file)
 {
     $filepath = $this->uploadConfig[(new \ReflectionClass($this->model))->getParentClass()->name]['file']['baseUrl'] . '/' . $this->model->file;
     $text = $file;
     if (in_array(strtolower(pathinfo($filepath)['extension']), ['jpg', 'png', 'gif', ''])) {
         $text = Html::img($filepath, ['alt' => isset($this->model->mediaI18ns[0]) ? $this->model->mediaI18ns[0]->title : $file, 'height' => '100px', 'class' => 'thumbnail center-block']);
     }
     return Html::a($text, $filepath, ['target' => '_blank']);
 }
Ejemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'rbac_user_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_user_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // upload config
     $uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
     // set items
     $items = [];
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'third_id', 'value' => $models['main']->third_id]);
     }
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password')]]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'password_repeat', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password_repeat')]]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'status', 'type' => 'activeDropDownList', 'data' => $dropDownList('user.status:required'), 'options' => ['class' => 'form-control input-sm']]);
     $items[] = new InputField(['model' => $models['user'], 'attribute' => 'active_password_reset', 'type' => 'activeCheckbox', 'options' => ['label' => '']]);
     if (!empty($models['rbacRoles'])) {
         $rbacRoles = [];
         foreach ($models['rbacRoles'] as $rbacRole) {
             $rbacRoles[$rbacRole->id] = $rbacRole->rbacRoleI18ns[0]->title;
         }
         $rbacUserRoles = [];
         foreach ($models['rbacUserRoles'] as $rbacUserRole) {
             $rbacUserRoles[] = $rbacUserRole->rbac_role_id;
         }
         $items[] = new SimpleValueField(['label' => Yii::t('kalibao.backend', 'person_user_roles'), 'value' => Html::checkboxList('rbacUserRolesId', $rbacUserRoles, $rbacRoles, ['unselect' => '-1'])]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
     }
     if (!$models['main']->isNewRecord) {
         $items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
     }
     $this->setItems($items);
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     // get app language of current application
     $languages = Yii::$app->appLanguage->getAppLanguages();
     $languageLabels = [];
     foreach ($languages as $languageId) {
         $languageLabels[$languageId] = I18N::label($languageId);
     }
     // build form
     $html = '<form method="post" class="current-language" action="' . Yii::$app->request->url . '">';
     $html .= Html::dropDownList('language', Yii::$app->language, $languageLabels, ['class' => 'language-selector form-control']);
     foreach ($languages as $languageId) {
         $html .= Html::hiddenInput($languageId, Url::to([''] + array_merge(Yii::$app->request->get(), ['language' => $languageId])));
     }
     $html .= '</form>';
     return $html;
 }
Ejemplo n.º 5
0
 /**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'checkbox-drop-down-list':
                 $this->dropDownLists['checkbox-drop-down-list'] = Html::checkboxInputFilterDropDownList();
                 break;
             case 'supplier.name':
                 $this->dropDownLists['supplier.name'] = Html::findDropDownListData('kalibao\\common\\models\\supplier\\Supplier', ['id', 'name'], []);
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }
Ejemplo n.º 6
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set titles
     $this->setCreateTitle(Yii::t('kalibao.backend', 'message_message_create_title'));
     $this->setUpdateTitle(Yii::t('kalibao.backend', 'message_message_update_title'));
     // models
     $models = $this->getModels();
     // language
     $language = $this->getLanguage();
     // get drop down list methods
     $dropDownList = $this->getDropDownList();
     // set items
     $items = [];
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'message_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'message_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-add-action' => Url::to('/message/message-group/create'), 'data-update-action' => Url::to('/message/message-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_message_group_title', 'data-text' => !empty($models['main']->message_group_id) ? MessageGroupI18n::findOne(['message_group_id' => $models['main']->message_group_id, 'i18n_id' => $language])->title : '']]);
     $items[] = new InputField(['model' => $models['main'], 'attribute' => 'source', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('source')]]);
     $models['i18ns'] = $this->orderLanguage($models['i18ns']);
     foreach ($models['i18ns'] as $languageId => $model) {
         $items[] = new InputField(['model' => $model, 'attribute' => 'translation', 'type' => 'activeTextarea', 'label' => Html::labelI18n($languageId), 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['main']->getAttributeLabel('translation'), 'maxlength' => true, 'name' => (new \ReflectionClass($model))->getShortName() . '[' . $languageId . '][translation]']]);
     }
     $this->setItems($items);
 }
Ejemplo n.º 7
0
 /**
  * @inheritdoc
  */
 protected function getAdvancedDropDownList($id, $search)
 {
     switch ($id) {
         case 'attribute_type.value':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\attributeType\\AttributeTypeI18n', ['concat(attribute_type_id, "|", value)', 'value'], [['LIKE', 'value', $search], ['i18n_id' => Yii::$app->language]], 10);
             break;
         default:
             return [];
             break;
     }
 }
Ejemplo n.º 8
0
 /**
  * @inheritdoc
  */
 protected function getAdvancedDropDownList($id, $search)
 {
     switch ($id) {
         case 'tree_type_i18n.label':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\treeType\\TreeTypeI18n', ['tree_type_id', 'label'], [['LIKE', 'label', $search], ['i18n_id' => Yii::$app->language]], 10);
             break;
         case 'media_i18n.title':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\media\\MediaI18n', ['media_id', 'title'], [['LIKE', 'title', $search], ['i18n_id' => Yii::$app->language]], 10);
             break;
         default:
             return [];
             break;
     }
 }
 /**
  * @inheritdoc
  */
 protected function getAdvancedDropDownList($id, $search)
 {
     switch ($id) {
         case 'language_i18n.title':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\language\\LanguageI18n', ['language_id', 'title'], [['LIKE', 'title', $search], ['i18n_id' => Yii::$app->language]], 10);
             break;
         default:
             return [];
             break;
     }
 }
Ejemplo n.º 10
0
/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/magesko/blob/master/LICENSE
 */
use yii\helpers\Url;
use kalibao\common\components\helpers\Html;
?>
<td class="td-inline-actions">
    <?php 
if (Yii::$app->user->canMultiple([$this->context->getActionControllerPermission('delete'), 'permission.delete:*'])) {
    ?>
    <div class="form-group">
        <label class="checkbox">
            <?php 
    echo Html::checkBox('rows[]', false, array('class' => 'check-row', 'id' => false, 'value' => http_build_query($row->getPk())));
    ?>
        </label>
    </div>
    <?php 
}
?>

    <?php 
if (Yii::$app->user->canMultiple([$this->context->getActionControllerPermission('update'), 'permission.update:*'])) {
    ?>
    <a href="<?php 
    echo Url::to(['edit-row'] + $row->getPk() + $row->requestParams);
    ?>
" class="btn-edit-row" title="<?php 
    echo Yii::t('kalibao', 'btn_edit_inline');
Ejemplo n.º 11
0
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/magesko/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
?>
<tr class="head-titles">
    <th class="th-quick-action"><span class="glyphicon glyphicon-list"></span></th>
    <?php 
foreach ($crudList->gridHeadAttributes as $attribute => $sortable) {
    ?>
        <th>
            <?php 
    if ($sortable === true) {
        ?>
                <?php 
        echo Html::sortLink($crudList->dataProvider->sort, $attribute);
        ?>
            <?php 
    } elseif ($sortable === false) {
        ?>
                <?php 
        echo $crudList->getModel('filter')->getAttributeLabel($attribute);
        ?>
            <?php 
    } else {
        ?>
                <?php 
        echo $sortable;
        ?>
            <?php 
    }
Ejemplo n.º 12
0
                    </table>
                    <div class="form-group">
                        <?php 
echo Html::activeHiddenInput($model, 'application');
?>
                        <?php 
echo Html::activeHiddenInput($model, 'controller');
?>
                        <?php 
echo Html::activeHiddenInput($model, 'module');
?>
                        <?php 
echo Html::activeHiddenInput($model, 'table');
?>
                        <?php 
echo Html::activeHiddenInput($model, 'translateGroup');
?>
                        <?php 
echo Html::hiddenInput('build', '1');
?>
                        <?php 
echo Html::submitButton('Validate', ['class' => 'btn btn-primary']);
?>
                    </div>
                <?php 
ActiveForm::end();
?>
            </div>
        </div>
    </section>
</div>
Ejemplo n.º 13
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set items
     $this->setItems([isset($this->model->languageGroupI18ns[0]) ? $this->model->languageGroupI18ns[0]->title : '', isset($this->model->languageI18ns[0]) ? $this->model->languageI18ns[0]->title : '', Html::activeCheckbox($this->model, 'activated', ['disabled' => 'disabled', 'label' => ''])]);
 }
Ejemplo n.º 14
0
 /**
  * Generates a hyperlink that can be clicked to cause sorting.
  * @param Sort $sort the current Sort instance
  * @param string $attribute the attribute name
  * @param array $options additional HTML attributes for the hyperlink tag.
  * There is one special attribute `label` which will be used as the label of the hyperlink.
  * If this is not set, the label defined in [[attributes]] will be used.
  * If no label is defined, [[\yii\helpers\Inflector::camel2words()]] will be called to get a label.
  * Note that it will not be HTML-encoded.
  * @return string
  */
 public static function sortLink(Sort $sort, $attribute, $options = [])
 {
     if (($direction = $sort->getAttributeOrder($attribute)) !== null) {
         $class = $direction === SORT_DESC ? 'current-sort desc' : 'current-sort asc';
         $icon = $direction === SORT_DESC ? 'glyphicon-sort-by-alphabet-alt' : 'glyphicon-sort-by-alphabet';
         if (isset($options['class'])) {
             $options['class'] .= ' ' . $class;
         } else {
             $options['class'] = $class;
         }
     } else {
         $icon = 'glyphicon-sort-by-alphabet';
         if (isset($options['class'])) {
             $options['class'] .= ' asc';
         } else {
             $options['class'] = 'asc';
         }
     }
     $url = $sort->createUrl($attribute);
     $options['data-sort'] = $sort->createSortParam($attribute);
     if (isset($options['label'])) {
         $label = $options['label'];
         unset($options['label']);
     } else {
         if (isset($sort->attributes[$attribute]['label'])) {
             $label = $sort->attributes[$attribute]['label'];
         } else {
             $label = Inflector::camel2words($attribute);
         }
     }
     $label .= ' <span class="glyphicon ' . $icon . '"></span>';
     return Html::a($label, $url, $options);
 }
Ejemplo n.º 15
0
 /**
  * @inheritdoc
  */
 protected function getAdvancedDropDownList($id, $search)
 {
     switch ($id) {
         case 'person.full_name':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\person\\Person', ['id', 'CONCAT(first_name, \' \', last_name) as full_name'], [['LIKE', 'first_name', $search]], 10);
             break;
         default:
             return [];
             break;
     }
 }
Ejemplo n.º 16
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/kalibao-framework/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
?>
<thead>
<tr class="form-inline">
    <th></th>
    <?php 
foreach ($crudTranslate->languages as $language) {
    ?>
        <th><?php 
    echo Html::labelI18n($language);
    ?>
</th>
    <?php 
}
?>
</tr>
</thead>
 /**
  * @inheritdoc
  */
 protected function getAdvancedDropDownList($id, $search)
 {
     switch ($id) {
         case 'cms_simple_menu_group_i18n.title':
             return Html::findAdvancedDropDownListData('kalibao\\common\\models\\cmsSimpleMenuGroup\\CmsSimpleMenuGroupI18n', ['cms_simple_menu_group_id', 'title'], [['LIKE', 'title', $search], ['i18n_id' => Yii::$app->language]], 10);
             break;
         default:
             return [];
             break;
     }
 }
Ejemplo n.º 18
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set items
     $this->setItems([isset($this->model->cmsNewsI18ns[0]) ? $this->model->cmsNewsI18ns[0]->title : '', isset($this->model->cmsNewsGroupI18ns[0]) ? $this->model->cmsNewsGroupI18ns[0]->title : '', Html::activeCheckbox($this->model, 'activated', ['disabled' => 'disabled', 'label' => '']), Yii::$app->formatter->asDatetime($this->model->published_at, I18N::getDateFormat(I18N::DATE_FORMAT))]);
 }
Ejemplo n.º 19
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/magesko/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
if ($hasErrors) {
    ?>
    <div class="callout callout-danger">
        <?php 
    echo Html::errorSummary($models);
    ?>
    </div>
<?php 
}
 /**
  * @inheritdoc
  */
 protected function getDropDownList($id)
 {
     if (!isset($this->dropDownLists[$id])) {
         switch ($id) {
             case 'language_group_i18n.title':
                 $this->dropDownLists['language_group_i18n.title'] = Html::findDropDownListData('kalibao\\common\\models\\languageGroup\\LanguageGroupI18n', ['language_group_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 break;
             case 'language_i18n.title':
                 $this->dropDownLists['language_i18n.title'] = Html::findDropDownListData('kalibao\\common\\models\\language\\LanguageI18n', ['language_id', 'title'], [['i18n_id' => Yii::$app->language]]);
                 break;
             case 'checkbox-drop-down-list':
                 $this->dropDownLists['checkbox-drop-down-list'] = Html::checkboxInputFilterDropDownList();
                 break;
             default:
                 return [];
                 break;
         }
     }
     return $this->dropDownLists[$id];
 }
Ejemplo n.º 21
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set items
     $this->setItems([$this->model->id, isset($this->model->branchTypeI18ns[0]) ? $this->model->branchTypeI18ns[0]->label : '', isset($this->model->treeI18ns[0]) ? $this->model->treeI18ns[0]->label : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->label : '', $this->model->order, isset($this->model->mediaI18ns[0]) ? $this->model->mediaI18ns[0]->title : '', Html::activeCheckbox($this->model, 'visible', ['disabled' => 'disabled', 'label' => '']), $this->model->background, Html::activeCheckbox($this->model, 'presentation_type', ['disabled' => 'disabled', 'label' => '']), $this->model->offset, Html::activeCheckbox($this->model, 'display_brands_types', ['disabled' => 'disabled', 'label' => '']), Html::activeCheckbox($this->model, 'big_menu_only_first_level', ['disabled' => 'disabled', 'label' => '']), Html::activeCheckbox($this->model, 'unfold', ['disabled' => 'disabled', 'label' => '']), isset($this->model->googleShoppingCategory) ? $this->model->googleShoppingCategory->id : '', Html::activeCheckbox($this->model, 'google_shopping', ['disabled' => 'disabled', 'label' => '']), isset($this->model->affiliationCategory) ? $this->model->affiliationCategory->id : '', Html::activeCheckbox($this->model, 'affiliation', ['disabled' => 'disabled', 'label' => '']), isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->label : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->description : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->url : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->meta_title : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->meta_description : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->meta_keywords : '', isset($this->model->branchI18ns[0]) ? $this->model->branchI18ns[0]->h1_tag : '', Yii::$app->formatter->asDatetime($this->model->created_at, I18N::getDateFormat()), Yii::$app->formatter->asDatetime($this->model->updated_at, I18N::getDateFormat())]);
 }
Ejemplo n.º 22
0
 /**
  * @return string
  */
 public function getId()
 {
     if ($this->id === null) {
         $inputID = Html::getInputId($this->model, $this->attribute);
         $this->id = 'inputfield-' . $inputID;
     }
     return $this->id;
 }
Ejemplo n.º 23
0
                <div class="col-xs-12">
                    <?php 
echo $form->field($model, 'username');
?>
                </div>
                <div class="col-xs-12">
                    <?php 
echo $form->field($model, 'password')->passwordInput();
?>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <?php 
echo $form->field($model, 'remember_me')->checkbox();
?>
                </div>
                <div class="col-xs-4">
                    <div class="form-group text-right">
                        <?php 
echo Html::submitButton(Yii::t('kalibao', 'login_btn_connect'), ['class' => 'btn btn-primary', 'name' => 'login-button']);
?>
                    </div>
                </div>
            </div>
        <?php 
ActiveForm::end();
?>
    </div><!-- /.login-box-body -->
</div>
Ejemplo n.º 24
0
?>
                <p class="help-block text-danger"></p>
            </div>
        </div>
        <div class="row control-group">
            <div class="form-group col-xs-12 floating-label-form-group controls">
                <?php 
echo $form->field($model, 'message')->textarea(['placeholder' => $model->getAttributeLabel('message'), 'class' => 'form-control']);
?>
                <p class="help-block text-danger"></p>
            </div>
        </div>
        <br />
        <div class="row control-group">
            <?php 
echo $form->field($model, 'verify_code')->widget(Captcha::className(), ['captchaAction' => '/contact/captcha', 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-3">{input}</div></div>']);
?>
        </div>
        <br>
        <div class="row">
            <div class="form-group col-xs-12">
                <?php 
echo Html::submitButton(Yii::t('kalibao', 'btn_send'), ['class' => 'btn btn-default']);
?>
            </div>
        </div>
        <?php 
ActiveForm::end();
?>
    </div>
</div>
Ejemplo n.º 25
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/kalibao-framework/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
?>
<tfoot>
    <tr>
        <td colspan="2" class="text-center">
            <?php 
echo Html::activeHiddenInput($crudEdit->models['main'], 'mail_template_id');
?>
            <?php 
if ($crudEdit->models['main']->isNewRecord && Yii::$app->user->canMultiple([$this->context->getActionControllerPermission('create'), 'permission.create:*']) || !$crudEdit->models['main']->isNewRecord && Yii::$app->user->canMultiple([$this->context->getActionControllerPermission('update'), 'permission.update:*'])) {
    ?>
                <button class="btn btn-primary btn-submit">
                    <span class="glyphicon glyphicon-floppy-disk"></span>
                    <span><?php 
    echo Yii::t('kalibao', 'btn_save');
    ?>
</span>
                </button>
            <?php 
}
?>
            <a href="<?php 
echo $crudEdit->closeAction;
?>
" class="btn btn-default btn-close">
Ejemplo n.º 26
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/magesko/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
?>
<tr class="form-inline">
    <?php 
echo $this->render('crud/list/_gridBodyRowInlineActions', ['row' => $row], $this->context);
?>
    <td><?php 
echo $row->items['cms_image_i18n_title'];
?>
</td>
    <td><?php 
echo $row->items['cms_image_group_i18n_title'];
?>
</td>
    <td>
        <?php 
echo Html::img($row->uploadConfig[(new \ReflectionClass($row->model))->getParentClass()->name]['file_path']['baseUrl'] . '/min/' . $row->model->file_path, ['width' => '200px', 'class' => 'overview']);
?>
    </td>
    <?php 
echo $this->render('crud/list/_gridBodyRowActions', ['row' => $row], $this->context);
?>
</tr>
Ejemplo n.º 27
0
<?php

use kalibao\common\components\helpers\Html;
foreach ($crudEdit->items['pageContents'] as $index => $itemField) {
    ?>
    <?php 
    if ($itemField->model->scenario !== 'delete') {
        ?>
    <tr class="page-contents">
        <th><?php 
        echo $itemField->label;
        ?>
 </th>
        <td>
            <div class="form-group<?php 
        echo $hasError = $itemField->model->hasErrors('content') ? ' has-error' : '';
        ?>
">
                <?php 
        echo Html::activeTextarea($itemField->model, $itemField->attribute, $itemField->options);
        ?>
                <div class="control-label help-inline"><?php 
        echo $hasError ? $itemField->model->getFirstError($itemField->attribute) : '';
        ?>
</div>
            </div>
        </td>
    </tr>
    <?php 
    }
}
Ejemplo n.º 28
0
    <tr>
        <td><?php 
        echo $rbacPermission->rbacPermissionI18ns[0]->title;
        ?>
</td>
        <?php 
        foreach ($models['rbacRoles'] as $rbacRole) {
            ?>
            <?php 
            if (isset($rbacRole->rbacRoleI18ns[0])) {
                ?>
                <td>
                    <?php 
                echo Html::hiddenInput('rbacRolesPermissions[' . $rbacRole->id . '][' . $rbacPermission->id . ']', 0);
                ?>
                    <?php 
                echo Html::checkbox('rbacRolesPermissions[' . $rbacRole->id . '][' . $rbacPermission->id . ']', $models['rbacRolesPermissions'][$rbacRole->id][$rbacPermission->id]->rbac_role_id == $rbacRole->id);
                ?>
                </td>
            <?php 
            }
            ?>
        <?php 
        }
        ?>
    </tr>
    <?php 
    }
}
?>
</tbody>
Ejemplo n.º 29
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/kalibao-framework/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
if ($crudEdit->hasErrors()) {
    ?>
    <div class="callout callout-danger">
        <?php 
    echo Html::errorSummary($crudEdit->models);
    ?>
    </div>
<?php 
}
Ejemplo n.º 30
0
<?php

/**
 * @copyright Copyright (c) 2015 Kévin Walter <*****@*****.**> - Kalibao
 * @license https://github.com/kalibao/magesko/blob/master/LICENSE
 */
use kalibao\common\components\helpers\Html;
if ($crudSetting->hasErrors()) {
    ?>
    <div class="alert alert-danger">
        <?php 
    echo Html::errorSummary($crudSetting->model);
    ?>
    </div>
<?php 
}