Example #1
0
 public function run()
 {
     $items = array();
     $controller = $this->controller;
     $action = $controller->action;
     foreach ($this->items as $item) {
         if (isset($item['visible']) && !$item['visible']) {
             continue;
         }
         $item2 = array();
         $item2['label'] = $item['label'];
         if (is_array($item['url'])) {
             $item2['url'] = $controller->createUrl($item['url'][0]);
         } else {
             $item2['url'] = $item['url'];
         }
         $pattern = isset($item['pattern']) ? $item['pattern'] : $item['url'];
         $item2['active'] = $this->isActive($pattern, $controller->uniqueID, $action->id);
         $item2['options'] = isset($item['options']) ? $item['options'] : '';
         $items[] = $item2;
     }
     MClientScript::registerScript('mainMenu');
     $this->render('wMainMenu', array('items' => $items));
 }
Example #2
0
  <div class="w3-form-row-input">
    <?php 
echo _CHtml::activeTextArea($model, 'content', array('class' => 'w3-input-text w3-input-w200percents ui-widget-content ui-corner-all', 'rows' => 10, 'cols' => 50)) . "\n";
?>
  </div>
  <div class="clear">&nbsp;</div>
</div>
<div class="w3-form-row w3-last">
  <div class="w3-form-row-label">&nbsp;</div>
  <div class="w3-form-row-input">
    <div class="w3-form-row-text">
      <?php 
echo Yii::t('hint', '{saveButton} or {cancelLink}', $update ? array('{saveButton}' => _CHtml::submitButton(Yii::t('link', 'Save'), array('class' => 'w3-input-button ui-state-default ui-corner-all')), '{cancelLink}' => CHtml::link(Yii::t('link', 'Cancel[form]'), array('show', 'id' => $model->id))) : array('{saveButton}' => _CHtml::submitButton(Yii::t('link', 'Create'), array('class' => 'w3-input-button ui-state-default ui-corner-all')), '{cancelLink}' => CHtml::link(Yii::t('link', 'Cancel[form]'), array($this->id . '/')))) . "\n";
?>
    </div>
  </div>
  <div class="clear">&nbsp;</div>
</div>

<?php 
echo _CHtml::endForm();
?>

</div><!-- w3-main-form-box -->

<?php 
MClientScript::registerScript('datepicker', array('selector' => "input[type='text'][name='Project[openDate]']"));
MClientScript::registerScript('datepicker', array('selector' => "input[type='text'][name='Project[closeDate]']"));
MClientScript::registerScript('focusOnFormFirstItem');
MClientScript::registerScript('formButton');
Example #3
0
    if ($n === 0) {
        $class .= 'w3-first ';
    }
    if ($n + 1 === $c) {
        $class .= 'w3-last ';
    }
    $link['text'] = '<span class="w3-inner-icon-left ui-icon ui-icon-' . (isset($link['icon']) ? $link['icon'] : 'radio-on') . '"></span>' . $link['text'];
    $link['options']['class'] = (isset($link['options']['class']) ? $link['options']['class'] . ' ' : '') . 'w3-with-icon-left';
    ?>
            <li<?php 
    echo $class === '' ? '' : ' class="' . $class . '"';
    ?>
><?php 
    echo CHtml::link($link['text'], $link['url'], $link['options']);
    ?>
</li>
<?php 
    $n++;
}
?>
        </ul>
      </div><!-- w3-link-list -->
    </div><!-- ui-widget -->
  </div><!-- w3-link-list-box -->
</div>
<?php 
if ($displayTitlebar) {
    MClientScript::registerScript('linkListClose');
}
MClientScript::registerScript('linkListHover');
Example #4
0
        $colNames = "''";
    }
    /*end if count columns*/
    $colModel = '';
    if (count($columnsModel)) {
        $n = 0;
        foreach ($columnsModel as $row) {
            $colModel .= ($n === 0 ? '' : ',') . "\n      {";
            $i = 0;
            foreach ($row as $k => $v) {
                $colModel .= ($i === 0 ? '' : ',') . $k . ':' . (is_string($v) ? "'" . $v . "'" : ($v === true ? 'true' : ($v === false ? 'false' : $v)));
                $i++;
            }
            $colModel .= "}";
            $n++;
        }
        /*end foreach row*/
    } else {
        $colModel = "\n      {name:'colModel',width:99}";
    }
    /*end if count columnsModel*/
    Yii::app()->getClientScript()->registerScript('grid[' . $gridId . ']', "\njQuery('#" . $gridId . "').removeClass('w3-hidden');\njQuery('#" . $gridPagerId . "').removeClass('w3-hidden');\njQuery('#" . $gridId . "').jqGrid({\n    url:'" . $url . "',\n    datatype: '" . $datatype . "',\n    mtype: '" . $mtype . "',\n    colNames: [" . $colNames . "],\n    colModel: [" . $colModel . "],\n    pager: '#" . $gridPagerId . "',\n    rowNum: " . $rowNum . ",\n    rowList: " . $rowList . ",\n    sortname: '" . $sortname . "',\n    sortorder: '" . $sortorder . "',\n    viewrecords: " . ($viewrecords === false ? 'false' : 'true') . "," . ($displayTitlebar ? "\n    caption: '" . $title . "'," : '') . "\n    height: " . $height . ",\n    gridComplete: function(){" . ($displaySGrid === true ? "\n        if(jQuery('#" . $sGridWrapperId . "').css('display') != 'none')\n            jQuery('#" . $sGridWrapperId . "').hide();" : '') . "\n    },\n    loadComplete: function(){" . ($displaySGrid === true && $hasLinkIcon === true ? '
        ' . MClientScript::registerScript('linkIcon', array('box' => 'w3-ig'), true) . ($registerGridLinkIcon ? '
        ' . MClientScript::registerScript('gridLinkIcon', array('controllerId' => $controllerId, 'gridId' => $gridId), true) : '') : '') . "\n    }\n});\njQuery('#" . $gridId . "').jqGrid('navGrid','#" . $gridPagerId . "',{edit:false,add:false,del:false});");
    /* gridComplete is called after most of the grid changes
     * loadComplete is called only after data is loaded*/
    Yii::app()->getClientScript()->registerCssFile(Yii::app()->request->baseUrl . '/static/css/jqgrid/ui.jqgrid.css');
    Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . '/static/js/jqgrid/i18n/grid.locale-' . (MPath::jqGridLocaleExists(Yii::app()->language) ? Yii::app()->language : 'en') . '.js', CClientScript::POS_BEGIN);
    Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . '/static/js/jqgrid/jquery.jqGrid.min.js', CClientScript::POS_BEGIN);
}
/*end if displayGrid*/
Example #5
0
    <?php 
echo _CHtml::activeTextField($model->details, 'occupation', array('class' => 'w3-input-text ui-widget-content ui-corner-all', 'maxlength' => 128)) . "\n";
?>
  </div>
  <div class="clear">&nbsp;</div>
</div>
<div class="w3-form-row w3-last">
  <div class="w3-form-row-label">&nbsp;</div>
  <div class="w3-form-row-input">
    <div class="w3-form-row-text">
      <?php 
echo Yii::t('hint', '{saveButton} or {cancelLink}', array('{saveButton}' => _CHtml::submitButton(Yii::t('link', 'Create'), array('class' => 'w3-input-button ui-state-default ui-corner-all')), '{cancelLink}' => CHtml::link(Yii::t('link', 'Cancel[form]'), array($this->id . '/')))) . "\n";
?>
    </div>
  </div>
  <div class="clear">&nbsp;</div>
</div>

<?php 
echo _CHtml::endForm();
?>

</div><!-- w3-main-form-box -->

<?php 
MClientScript::registerScript('autocompleteOff', array('selector' => '.w3-content form.w3-main-form'));
MClientScript::registerScript('focusOnFormFirstItem');
MClientScript::registerScript('formButton');
if ($model->hasVirtualAttribute('username')) {
    MClientScript::registerScript('screenNameSame');
}
Example #6
0
        $this->widget('application.components.WDropDownLink', array('parameters' => $link['dropDown'], 'options' => $link['options'], 'text' => $link['text'], 'url' => $link['url']));
        ?>
    </li>
<?php 
    } else {
        if (isset($link['icon'])) {
            $link['text'] = '<span class="w3-inner-icon-left ui-icon ui-icon-' . $link['icon'] . '"></span>' . $link['text'];
            $link['options']['class'] = (isset($link['options']['class']) ? $link['options']['class'] . ' ' : '') . 'w3-with-icon-left';
        }
        ?>
    <li class="<?php 
        echo $class;
        ?>
ui-state-default ui-corner-all"><?php 
        echo CHtml::link($link['text'], $link['url'], $link['options']);
        ?>
</li>
<?php 
    }
    $n++;
}
?>
  </ul>
</div>
<div class="clear">&nbsp;</div>
<?php 
MClientScript::registerScript('actionButton');
/*button hover effects*/
?>