/**
  * @param string $view the view to be rendered
  * @return bool
  */
 public function beforeRender($view)
 {
     $this->pageTitle = $this->pageHeading = Yii::t('dressing', 'My Account');
     if ($view != 'login') {
         $this->menu = YdSiteMenu::getItemsFromMenu('User');
     }
     return parent::beforeRender($view);
 }
Exemplo n.º 2
0
<?php

/**
 * @var $this YdWebController
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-skeleton
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
$this->pageTitle = Yii::t('dressing', 'Documentation');
// menu
$this->menu = YdSiteMenu::getItemsFromMenu('Help');
// breadcrumbs
$this->addBreadcrumb(Yii::t('dressing', 'Help'), array('/site/page', 'view' => 'help'));
echo '<h2>' . Yii::t('dressing', 'Vendor Documentation') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'stacked' => false, 'items' => array(array('label' => Yii::t('dressing', 'Yii'), 'url' => 'http://www.yiiframework.com/doc/'), array('label' => Yii::t('dressing', 'YiiExt'), 'url' => 'http://yiiext.github.io/'), array('label' => Yii::t('dressing', 'Yii Booster'), 'url' => 'http://yiibooster.clevertech.biz/'), array('label' => Yii::t('dressing', 'Yii Bootstrap'), 'url' => 'http://www.cniska.net/yii-bootstrap'), array('label' => Yii::t('dressing', 'Bootstrap'), 'url' => 'http://twitter.github.io/bootstrap/'), array('label' => Yii::t('dressing', 'jQuery'), 'url' => 'http://api.jquery.com/'), array('label' => Yii::t('dressing', 'Swift Mailer'), 'url' => 'http://swiftmailer.org/docs/introduction.html'), array('label' => Yii::t('dressing', 'Mustache PHP'), 'url' => 'https://github.com/bobthecow/mustache.php'), array('label' => Yii::t('dressing', 'Kint'), 'url' => 'http://raveren.github.io/kint/'), array('label' => Yii::t('dressing', 'Highcharts'), 'url' => 'http://api.highcharts.com/highcharts'))));
Exemplo n.º 3
0
<?php

/**
 * @var $this SettingController
 * @var $settings YdSetting[]
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
$this->pageTitle = Yii::t('dressing', 'Settings');
$this->menu = YdSiteMenu::getItemsFromMenu('Settings', YdSiteMenu::MENU_ADMIN);
/** @var YdActiveForm $form */
$form = $this->beginWidget('dressing.widgets.YdActiveForm', array('id' => 'setting-form', 'type' => 'horizontal'));
echo $form->beginModalWrap();
echo $form->errorSummary($settings);
echo '<h2>' . Yii::t('dressing', 'Core Settings') . '</h2>';
echo '<fieldset><legend>' . Yii::t('dressing', 'Version Settings') . '</legend>';
echo $form->textFieldRow($settings['id'], 'value', array('name' => 'YdSetting[id][value]', 'labelOptions' => array('for' => 'YdSetting_id_value')));
echo $form->dropDownListRow($settings['app_version'], 'value', YdSetting::appVersions(), array('name' => 'YdSetting[app_version][value]', 'labelOptions' => array('for' => 'YdSetting_app_version_value')));
//echo $form->dropDownListRow($settings['yii_version'], 'value', YdSetting::yiiVersions(), array('name' => 'YdSetting[yii_version][value]', 'labelOptions' => array('for' => 'YdSetting_yii_version_value')));
//echo $form->checkBoxRow($settings['yii_lite'], 'value', array('name' => 'YdSetting[yii_lite][value]', 'labelOptions' => array('for' => 'YdSetting_yii_lite_value')));
echo '</fieldset>';
echo '<fieldset><legend>' . Yii::t('dressing', 'Debug Settings') . '</legend>';
echo $form->checkBoxRow($settings['debug'], 'value', array('name' => 'YdSetting[debug][value]', 'labelOptions' => array('for' => 'YdSetting_debug_value')));
echo $form->textFieldRow($settings['debug_levels'], 'value', array('name' => 'YdSetting[debug_levels][value]', 'labelOptions' => array('for' => 'YdSetting_debug_levels_value')));
echo $form->checkBoxRow($settings['debug_db'], 'value', array('name' => 'YdSetting[debug_db][value]', 'labelOptions' => array('for' => 'YdSetting_debug_db_value')));
echo $form->textFieldRow($settings['error_email'], 'value', array('name' => 'YdSetting[error_email][value]', 'labelOptions' => array('for' => 'YdSetting_error_email_value')));
echo '</fieldset>';
Exemplo n.º 4
0
<?php

/**
 * @var $this YdAccountController
 * @var $form YdActiveForm
 * @var $user YdUser
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
$this->pageTitle = Yii::t('dressing', 'Account Settings');
$this->menu = YdSiteMenu::getItemsFromMenu('User');
/** @var YdActiveForm $form */
$form = $this->beginWidget('dressing.widgets.YdActiveForm', array('id' => 'account-form', 'type' => 'horizontal'));
echo $form->beginModalWrap();
echo $form->errorSummary($user);
?>
    <div class="control-group">
        <?php 
echo CHtml::label(Yii::t('dressing', 'Theme'), 'UserEav_theme', array('class' => 'control-label'));
?>
        <div class="controls">
            <?php 
echo CHtml::dropDownList('UserEav[theme]', $user->getEavAttribute('theme'), YdSetting::themes());
?>
        </div>
    </div>
<?php 
Exemplo n.º 5
0
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
$this->pageTitle = $this->getName() . ' ' . Yii::t('dressing', ucfirst($task));
$menu = $id ? YdSiteMenu::model()->findByPk($id) : new YdSiteMenu('search');
/** @var YdActiveForm $form */
$form = $this->beginWidget('dressing.widgets.YdActiveForm', array('id' => 'menu-' . $task . '-form', 'type' => 'horizontal', 'action' => array('/menu/delete', 'id' => $id, 'task' => $task, 'confirm' => 1)));
echo $this->getGridIdHiddenFields($id);
echo $form->beginModalWrap();
echo $form->errorSummary($menu);
echo '<fieldset>';
echo '<legend>' . Yii::t('dressing', 'Selected Records') . '</legend>';
$menus = YdSiteMenu::model()->findAll('t.id IN (' . implode(',', YdHelper::getGridIds($id)) . ')');
if ($menus) {
    echo '<ul>';
    foreach ($menus as $menu) {
        echo '<li>';
        echo $menu->getName();
        echo '</li>';
    }
    echo '</ul>';
}
echo '</fieldset>';
echo $form->endModalWrap();
echo '<div class="' . $form->getSubmitRowClass() . '">';
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => Yii::t('dressing', 'Confirm ' . ucfirst($task)), 'htmlOptions' => array('class' => 'pull-right')));
echo '</div>';
$this->endWidget();
Exemplo n.º 6
0
<?php

/**
 * @var $this YdSiteMenuController
 * @var $menu YdSiteMenu
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
/** @var YdActiveForm $form */
$form = $this->beginWidget('dressing.widgets.YdActiveForm', array('id' => 'menu-form', 'type' => 'horizontal'));
echo $form->beginModalWrap();
echo $form->errorSummary($menu);
echo $form->dropDownListRow($menu, 'parent_id', YdSiteMenu::model()->getDropDown(), array('empty' => ''));
echo $form->textFieldRow($menu, 'label');
echo $form->textFieldRow($menu, 'icon');
echo $form->textFieldRow($menu, 'url');
echo $form->textFieldRow($menu, 'url_params');
echo $form->textFieldRow($menu, 'target');
echo $form->textFieldRow($menu, 'access_role');
echo $form->checkBoxRow($menu, 'enabled');
echo $form->endModalWrap();
echo $form->getSubmitButtonRow($menu->isNewRecord ? Yii::t('dressing', 'Create') : Yii::t('dressing', 'Save'));
$this->endWidget();
Exemplo n.º 7
0
<?php

/**
 * @var $this YdSiteMenuController
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
$this->pageTitle = $this->getName() . ' ' . Yii::t('dressing', 'List');
$this->renderPartial('/siteMenu/_menu');
echo '<div class="spacer">';
$this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('dressing', 'Create') . ' ' . $this->getName(), 'url' => array('/menu/create'), 'type' => 'primary', 'htmlOptions' => array('data-toggle' => 'modal-remote')));
echo '</div>';
$this->widget('zii.widgets.CMenu', array('items' => YdSiteMenu::getTree()));
Exemplo n.º 8
0
<?php

/**
 * @var $this YdUserController
 * @var $user YdUser
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
// index
if (!isset($user)) {
    $this->menu = YdSiteMenu::getItemsFromMenu('Manage', YdSiteMenu::MENU_ADMIN);
    return;
    // no more links
}
$menu = array();
// create
if ($user->isNewRecord) {
    //$menu[] = array(
    //    'label' => Yii::t('app', 'Create'),
    //    'url' => array('/user/create'),
    //);
    return;
    // no more links
}
// view
$menu[] = array('label' => Yii::t('app', 'View'), 'url' => $user->getUrl());
// others
Exemplo n.º 9
0
<?php

/**
 * @var $this YdAttachmentController
 * @var $attachment YdAttachment
 *
 * @author Brett O'Donnell <*****@*****.**>
 * @author Zain Ul abidin <*****@*****.**>
 * @copyright 2013 Mr PHP
 * @link https://github.com/cornernote/yii-dressing
 * @license BSD-3-Clause https://raw.github.com/cornernote/yii-dressing/master/license.txt
 */
Yii::app()->user->setState('index.attachment', Yii::app()->request->requestUri);
$this->pageTitle = $this->getName() . ' ' . Yii::t('dressing', 'List');
$this->menu = YdSiteMenu::getItemsFromMenu('Main');
echo '<div class="spacer">';
$this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('dressing', 'Create') . ' ' . $this->getName(), 'url' => array('/attachment/create'), 'type' => 'primary', 'htmlOptions' => array('data-toggle' => 'modal-remote')));
echo ' ';
$this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('dressing', 'Search'), 'htmlOptions' => array('class' => 'attachment-grid-search'), 'toggle' => true));
if (Yii::app()->user->getState('index.attachment') != Yii::app()->createUrl('/attachment/index')) {
    echo ' ';
    $this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('dressing', 'Reset Filters'), 'url' => array('/attachment/index')));
}
echo '</div>';
// search
$this->renderPartial('/attachment/_search', array('attachment' => $attachment));
// grid
$this->renderPartial('/attachment/_grid', array('attachment' => $attachment));
 /**
  * Handle ordering.
  */
 public function actionOrder()
 {
     if (isset($_POST['Order'])) {
         $menus = explode(',', $_POST['Order']);
         foreach ($menus as $k => $menu_id) {
             if ($menu = YdSiteMenu::model()->findbyPk($menu_id)) {
                 $menu->sort_order = $k;
                 $menu->save(false);
             }
         }
     }
 }
Exemplo n.º 11
0
<?php

/**
 * @var $this ToolController
 */
$this->pageTitle = Yii::t('dressing', 'Tools');
echo '<h2>' . t('Manage') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => YdSiteMenu::getItemsFromMenu('Manage', YdSiteMenu::MENU_ADMIN)));
echo '<h2>' . t('Settings') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => YdSiteMenu::getItemsFromMenu('Settings', YdSiteMenu::MENU_ADMIN)));
echo '<h2>' . t('Reports') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => YdSiteMenu::getItemsFromMenu('Reports', YdSiteMenu::MENU_ADMIN)));
echo '<h2>' . t('Logs') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => YdSiteMenu::getItemsFromMenu('Logs', YdSiteMenu::MENU_ADMIN)));
echo '<h2>' . t('Tools') . '</h2>';
$this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => YdSiteMenu::getItemsFromMenu('Tools', YdSiteMenu::MENU_ADMIN)));