예제 #1
0
 /**
  * Register Script
  */
 public function registerScript()
 {
     $basePath = Yii::getPathOfAlias('application.modules.user.views.asset');
     $baseUrl = Yii::app()->getAssetManager()->publish($basePath);
     $cs = Yii::app()->getClientScript();
     $cs->registerCoreScript('jquery');
     $cs->registerCssFile($baseUrl . '/css/redmond/jquery-ui.css');
     $cs->registerCssFile($baseUrl . '/css/style.css');
     $cs->registerScriptFile($baseUrl . '/js/jquery-ui.min.js');
     $cs->registerScriptFile($baseUrl . '/js/form.js');
     $cs->registerScriptFile($baseUrl . '/js/jquery.json.js');
     $widgets = self::getWidgets();
     $wgByTypes = ProfileField::itemAlias('field_type');
     foreach ($wgByTypes as $k => $v) {
         $wgByTypes[$k] = array();
     }
     foreach ($widgets[1] as $widget) {
         if (isset($widget['fieldType']) && count($widget['fieldType'])) {
             foreach ($widget['fieldType'] as $type) {
                 array_push($wgByTypes[$type], $widget['name']);
             }
         }
     }
     //echo '<pre>'; print_r($widgets[1]); die();
     $js = "\n\n\tvar name = \$('#name'),\n\tvalue = \$('#value'),\n\tallFields = \$([]).add(name).add(value),\n\ttips = \$('.validateTips');\n\t\n\tvar listWidgets = jQuery.parseJSON('" . str_replace("'", "\\'", CJavaScript::jsonEncode($widgets[0])) . "');\n\tvar widgets = jQuery.parseJSON('" . str_replace("'", "\\'", CJavaScript::jsonEncode($widgets[1])) . "');\n\tvar wgByType = jQuery.parseJSON('" . str_replace("'", "\\'", CJavaScript::jsonEncode($wgByTypes)) . "');\n\t\n\tvar fieldType = {\n\t\t\t'INTEGER':{\n\t\t\t\t'hide':['match','other_validator','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':10,\n\t\t\t\t\t'default':'0',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'VARCHAR':{\n\t\t\t\t'hide':['widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':255,\n\t\t\t\t\t'default':'',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'TEXT':{\n\t\t\t\t'hide':['field_size','range','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':0,\n\t\t\t\t\t'default':'',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'DATE':{\n\t\t\t\t'hide':['field_size','field_size_min','match','range','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':0,\n\t\t\t\t\t'default':'0000-00-00',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'FLOAT':{\n\t\t\t\t'hide':['match','other_validator','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':'10.2',\n\t\t\t\t\t'default':'0.00',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'DECIMAL':{\n\t\t\t\t'hide':['match','other_validator','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':'10,2',\n\t\t\t\t\t'default':'0',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'BOOL':{\n\t\t\t\t'hide':['field_size','field_size_min','match','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':0,\n\t\t\t\t\t'default':0,\n\t\t\t\t\t'range':'1==" . UserModule::t('Yes') . ";0==" . UserModule::t('No') . "',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'BLOB':{\n\t\t\t\t'hide':['field_size','field_size_min','match','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':0,\n\t\t\t\t\t'default':'',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t},\n\t\t\t'BINARY':{\n\t\t\t\t'hide':['field_size','field_size_min','match','widgetparams'],\n\t\t\t\t'val':{\n\t\t\t\t\t'field_size':0,\n\t\t\t\t\t'default':'',\n\t\t\t\t\t'range':'',\n\t\t\t\t\t'widgetparams':''\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\t\n\tfunction showWidgetList(type) {\n\t\t\$('div.widget select').empty();\n\t\t\$('div.widget select').append('<option value=\"\">" . UserModule::t('No') . "</option>');\n\t\tif (wgByType[type]) {\n\t\t\tfor (var k in wgByType[type]) {\n\t\t\t\t\$('div.widget select').append('<option value=\"'+wgByType[type][k]+'\">'+widgets[wgByType[type][k]]['label']+'</option>');\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tfunction setFields(type) {\n\t\tif (fieldType[type]) {\n\t\t\tif (" . (isset($_GET['id']) ? 0 : 1) . ") {\n\t\t\t\tshowWidgetList(type);\n\t\t\t\t\$('#widgetlist option:first').attr('selected', 'selected');\n\t\t\t}\n\t\t\t\n\t\t\t\$('div.row').addClass('toshow').removeClass('tohide');\n\t\t\tif (fieldType[type].hide.length) \$('div.'+fieldType[type].hide.join(', div.')).addClass('tohide').removeClass('toshow');\n\t\t\tif (\$('div.widget select').val()) {\n\t\t\t\t\$('div.widgetparams').removeClass('tohide');\n\t\t\t}\n\t\t\t\$('div.toshow').show(500);\n\t\t\t\$('div.tohide').hide(500);\n\t\t\t" . (!isset($_GET['id']) ? "\n\t\t\tfor (var k in fieldType[type].val) { \n\t\t\t\t\$('div.'+k+' input').val(fieldType[type].val[k]);\n\t\t\t}" : '') . "\n\t\t}\n\t}\n\t\n\tfunction isArray(obj) {\n\t\tif (obj.constructor.toString().indexOf('Array') == -1)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}\n\t\t\n\t\$('#dialog-form').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 400,\n\t\tmodal: true,\n\t\tbuttons: {\n\t\t\t'" . UserModule::t('Save') . "': function() {\n\t\t\t\tvar wparam = {};\n\t\t\t\tvar fparam = {};\n\t\t\t\t\$('#dialog-form fieldset .wparam').each(function(){\n\t\t\t\t\tif (\$(this).val()) wparam[\$(this).attr('name')] = \$(this).val();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tvar tab = \$('#tabs ul li.ui-tabs-selected').text();\n\t\t\t\tfparam[tab] = {};\n\t\t\t\t\$('#dialog-form fieldset .tab-'+tab).each(function(){\n\t\t\t\t\tif (\$(this).val()) fparam[tab][\$(this).attr('name')] = \$(this).val();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif (\$.JSON.encode(wparam)!='{}') \$('div.widgetparams input').val(\$.JSON.encode(wparam));\n\t\t\t\tif (\$.JSON.encode(fparam[tab])!='{}') \$('div.other_validator input').val(\$.JSON.encode(fparam)); \n\t\t\t\t\n\t\t\t\t\$(this).dialog('close');\n\t\t\t},\n\t\t\t'" . UserModule::t('Cancel') . "': function() {\n\t\t\t\t\$(this).dialog('close');\n\t\t\t}\n\t\t},\n\t\tclose: function() {\n\t\t}\n\t});\n\n\n\t\$('#widgetparams').focus(function() {\n\t\tvar widget = widgets[\$('#widgetlist').val()];\n\t\tvar html = '';\n\t\tvar wparam = (\$('div.widgetparams input').val())?\$.JSON.decode(\$('div.widgetparams input').val()):{};\n\t\tvar fparam = (\$('div.other_validator input').val())?\$.JSON.decode(\$('div.other_validator input').val()):{};\n\t\t\n\t\t// Class params\n\t\tfor (var k in widget.params) {\n\t\t\thtml += '<label for=\"name\">'+((widget.paramsLabels[k])?widget.paramsLabels[k]:k)+'</label>';\n\t\t\thtml += '<input type=\"text\" name=\"'+k+'\" id=\"widget_'+k+'\" class=\"text wparam ui-widget-content ui-corner-all\" value=\"'+((wparam[k])?wparam[k]:widget.params[k])+'\" />';\n\t\t}\n\t\t// Validator params\t\t\n\t\tif (widget.other_validator) {\n\t\t\tvar tabs = '';\n\t\t\tvar li = '';\n\t\t\tfor (var t in widget.other_validator) {\n\t\t\t\ttabs += '<div id=\"tab-'+t+'\" class=\"tab\">';\n\t\t\t\tli += '<li'+((fparam[t])?' class=\"ui-tabs-selected\"':'')+'><a href=\"#tab-'+t+'\">'+t+'</a></li>';\n\t\t\t\t\n\t\t\t\tfor (var k in widget.other_validator[t]) {\n\t\t\t\t\ttabs += '<label for=\"name\">'+((widget.paramsLabels[k])?widget.paramsLabels[k]:k)+'</label>';\n\t\t\t\t\tif (isArray(widget.other_validator[t][k])) {\n\t\t\t\t\t\ttabs += '<select type=\"text\" name=\"'+k+'\" id=\"filter_'+k+'\" class=\"text fparam ui-widget-content ui-corner-all tab-'+t+'\">';\n\t\t\t\t\t\tfor (var i in widget.other_validator[t][k]) {\n\t\t\t\t\t\t\ttabs += '<option value=\"'+widget.other_validator[t][k][i]+'\"'+((fparam[t]&&fparam[t][k])?' selected=\"selected\"':'')+'>'+widget.other_validator[t][k][i]+'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabs += '</select>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttabs += '<input type=\"text\" name=\"'+k+'\" id=\"filter_'+k+'\" class=\"text fparam ui-widget-content ui-corner-all tab-'+t+'\" value=\"'+((fparam[t]&&fparam[t][k])?fparam[t][k]:widget.other_validator[t][k])+'\" />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttabs += '</div>';\n\t\t\t}\n\t\t\thtml += '<div id=\"tabs\"><ul>'+li+'</ul>'+tabs+'</div>';\n\t\t}\n\t\t\n\t\t\$('#dialog-form fieldset').html(html);\n\t\t\n\t\t\$('#tabs').tabs();\n\t\t\n\t\t// Show form\n\t\t\$('#dialog-form').dialog('open');\n\t});\n\t\n\t\$('#field_type').change(function() {\n\t\tsetFields(\$(this).val());\n\t});\n\t\n\t\$('#widgetlist').change(function() {\n\t\tif (\$(this).val()) {\n\t\t\t\$('div.widgetparams').show(500);\n\t\t} else {\n\t\t\t\$('div.widgetparams').hide(500);\n\t\t}\n\t\t\n\t});\n\t\n\t// show all function \n\t\$('div.form p.note').append('<br/><a href=\"#\" id=\"showAll\">" . UserModule::t('Show all') . "</a>');\n \t\$('#showAll').click(function(){\n\t\t\$('div.row').show(500);\n\t\treturn false;\n\t});\n\t\n\t// init\n\tsetFields(\$('#field_type').val());\n\t\n\t";
     $cs->registerScript(__CLASS__ . '#dialog', $js);
 }
예제 #2
0
파일: _form.php 프로젝트: brettbrusda/chat
?>
		<?php 
echo CHtml::error($model, 'position');
?>
		<p class="hint"><?php 
echo UserModule::t('Display order of fields.');
?>
</p>
	</div>

	<div class="row visible">
		<?php 
echo CHtml::activeLabelEx($model, 'visible');
?>
		<?php 
echo CHtml::activeDropDownList($model, 'visible', ProfileField::itemAlias('visible'));
?>
		<?php 
echo CHtml::error($model, 'visible');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save'));
?>
	</div>

<?php 
echo CHtml::endForm();
?>
예제 #3
0
파일: admin.php 프로젝트: yinhe/yincart
<?php

$this->breadcrumbs = array(UserModule::t('Profile Fields') => array('admin'), UserModule::t('Manage'));
$this->menu = array(array('label' => UserModule::t('Create Profile Field'), 'url' => array('create')), array('label' => UserModule::t('Manage Profile Field'), 'url' => array('admin')), array('label' => UserModule::t('Manage Users'), 'url' => array('/user/admin')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n    \$('.search-form').toggle();\n    return false;\n});\n\$('.search-form form').submit(function(){\n    \$.fn.yiiGridView.update('profile-field-grid', {\n        data: \$(this).serialize()\n    });\n    return false;\n});\n");
?>
<h1><?php 
echo UserModule::t('Manage Profile Fields');
?>
</h1>

<p><?php 
echo UserModule::t("You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.");
?>
</p>

<?php 
echo CHtml::link(UserModule::t('Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'varname', 'type' => 'raw', 'value' => 'UHtml::markSearch($data,"varname")'), array('name' => 'title', 'value' => 'UserModule::t($data->title)'), array('name' => 'field_type', 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'field_size', array('name' => 'required', 'value' => 'ProfileField::itemAlias("required",$data->required)', 'filter' => ProfileField::itemAlias("required")), 'position', array('name' => 'visible', 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), array('class' => 'bootstrap.widgets.TbButtonColumn'))));
예제 #4
0
<?php

$this->breadcrumbs = array(UserModule::t('Profile Fields') => array('admin'), UserModule::t('Manage'));
$this->menu = array(array('label' => UserModule::t('Create Profile Field'), 'url' => array('create')), array('label' => UserModule::t('Manage Profile Field'), 'url' => array('admin')), array('label' => UserModule::t('Manage Users'), 'url' => array('/user/admin')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n    \$('.search-form').toggle();\n    return false;\n});\n\$('.search-form form').submit(function(){\n    \$.fn.yiiGridView.update('profile-field-grid', {\n        data: \$(this).serialize()\n    });\n    return false;\n});\n");
?>
<h1><?php 
echo UserModule::t('Manage Profile Fields');
?>
</h1>

<p class="helper"><?php 
echo UserModule::t("You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.");
?>
</p>

<?php 
echo CHtml::link(UserModule::t('Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
//$this->widget('zii.widgets.grid.CGridView', array(
$this->widget('JGridView', array('dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'id', 'htmlOptions' => array('class' => 'id-column')), array('name' => 'varname', 'type' => 'raw', 'value' => 'UHtml::markSearch($data,"varname")'), array('name' => 'title', 'value' => 'UserModule::t($data->title)'), array('name' => 'field_type', 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'field_size', array('name' => 'required', 'value' => 'ProfileField::itemAlias("required",$data->required)', 'filter' => ProfileField::itemAlias("required")), 'position', array('name' => 'visible', 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), array('class' => 'CButtonColumn', 'template' => '{update}{delete}', 'updateButtonImageUrl' => Yii::app()->theme->baseUrl . '/images/update16x16.png', 'deleteButtonImageUrl' => Yii::app()->theme->baseUrl . '/images/delete16x16.png'))));
예제 #5
0
echo $form->dropDownListRow($model, 'widget', $widgetsList, array('class' => 'widget', 'id' => 'widgetlist', 'hint' => UserModule::t('Widget name.')));
?>
    </div>
    <div class="formrow widgetparams">
        <?php 
echo $form->textFieldRow($model, 'widgetparams', array('class' => 'widgetparams', 'size' => 60, 'maxlength' => 5000, 'id' => 'widgetparams', 'hint' => UserModule::t('JSON string (example: {example}).', array('{example}' => CJavaScript::jsonEncode(array('param1' => array('val1', 'val2'), 'param2' => array('k1' => 'v1', 'k2' => 'v2')))))));
?>
	</div>
	<div class="formrow position">
	   <?php 
echo $form->textFieldRow($model, 'position', array('class' => 'position', 'hint' => UserModule::t('Display order of fields.')));
?>
	</div>
	<div class="formrow visible">
	   <?php 
echo $form->dropDownListRow($model, 'visible', ProfileField::itemAlias('visible'), array('class' => 'visible'));
?>
	</div>
	<div class="form-actions">
        <?php 
$this->widget('bootstrap.widgets.TbButton', array('type' => 'primary', 'buttonType' => 'submit', 'label' => $model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save')));
?>
    </div>
	
	<?php 
/*
	<div class="row varname">
		<?php echo CHtml::activeLabelEx($model,'varname'); ?>
		<?php echo (($model->id)?CHtml::activeTextField($model,'varname',array('size'=>60,'maxlength'=>50,'readonly'=>true)):CHtml::activeTextField($model,'varname',array('size'=>60,'maxlength'=>50))); ?>
		<?php echo CHtml::error($model,'varname'); ?>
		<p class="hint"><?php echo UserModule::t("Allowed lowercase letters and digits."); ?></p>
예제 #6
0
?>
        <?php 
echo $form->textFieldRow($model, 'error_message', array('size' => 60, 'maxlength' => 255));
?>
        <?php 
echo $form->textFieldRow($model, 'other_validator', array('size' => 60, 'maxlength' => 5000));
?>
        <?php 
echo $form->textFieldRow($model, 'default', array('size' => 60, 'maxlength' => 255));
?>
        <?php 
echo $form->textFieldRow($model, 'widget', array('size' => 60, 'maxlength' => 255));
?>
        <?php 
echo $form->textFieldRow($model, 'widgetparams', array('size' => 60, 'maxlength' => 5000));
?>
        <?php 
echo $form->textFieldRow($model, 'position');
?>
        <?php 
echo $form->dropDownListRow($model, 'visible', ProfileField::itemAlias('visible'));
?>

    <div class="form-actions">
        <?php 
$this->widget('bootstrap.widgets.TbButton', array('type' => 'primary', 'buttonType' => 'submit', 'label' => UserModule::t('Search')));
?>
    </div>

<?php 
$this->endWidget();
예제 #7
0
<p><?php 
echo UserModule::t("You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.");
?>
</p>

<?php 
echo CHtml::link(UserModule::t('Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
    <?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $model->search(), 'columns' => array(array('name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('style' => 'display:none;'), 'headerHtmlOptions' => array('style' => 'display:none;')), array('header' => '# ', 'value' => '$data->position'), array('name' => 'title', 'value' => 'UserModule::t($data->title)'), array('name' => 'field_type', 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'group', 'subgroup', array('name' => 'visible', 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), 'visible_for_role', array('class' => 'CButtonColumn'))));
?>

<?php 
Yii::app()->clientScript->registerCoreScript('jquery.ui');
?>
<script type="text/javascript">
    $(function() {
        $( "table.items tbody" ).sortable({ 
            items: 'tr',
            update : function () { 
                var order = [];
                $('table.items tbody tr').each(function(i,item) {
                    order.push($(item).find('td:eq(0)').text() * 1);
                    $(item).find('td:eq(1)').text(i + 1);
                });
예제 #8
0
파일: _form.php 프로젝트: piond/new_rsud
					<?php 
echo UserModule::t('Display order of fields.');
?>
				</span>
			</div>
		</div>

		<div class="form-group">
			<label class="control-label col-sm-3">
				<?php 
echo CHtml::activeLabelEx($model, 'visible');
?>
			</label>
			<div class="col-sm-9">
				<?php 
echo CHtml::activeDropDownList($model, 'visible', ProfileField::itemAlias('visible'), array('class' => 'form-control'));
?>
				<span class="help-block error">
					<?php 
echo CHtml::error($model, 'visible');
?>
				</span>
			</div>
		</div>
		
		<div class="form-actions text-right">
		<?php 
$this->widget('booster.widgets.TbButton', array('buttonType' => 'submit', 'context' => 'primary', 'label' => $model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save')));
?>
		</div>
예제 #9
0
  </div>
 </td>
 <td valign="top">
<div class="cont_right formWrapper">
<h1><?php 
echo UserModule::t('Manage Profile Fields');
?>
</h1>
<div class="edit_bttns" style="top:15px; right:20px">
    <ul>
    <li>
     <?php 
echo CHtml::link(Yii::t('user', '<span>Create Profile Field</span>'), array('profileField/create'), array('class' => 'addbttn last'));
?>
    </li>
    </ul>
    <div class="clear"></div>
    </div>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $model->search(), 'pager' => array('cssFile' => Yii::app()->baseUrl . '/css/formstyle.css'), 'cssFile' => Yii::app()->baseUrl . '/css/formstyle.css', 'columns' => array('id', array('name' => 'varname', 'type' => 'raw', 'value' => 'UHtml::markSearch($data,"varname")'), array('name' => 'title', 'value' => 'UserModule::t($data->title)'), array('name' => 'field_type', 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'field_size', array('name' => 'required', 'value' => 'ProfileField::itemAlias("required",$data->required)', 'filter' => ProfileField::itemAlias("required")), 'position', array('name' => 'visible', 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), array('class' => 'CButtonColumn'))));
?>
</div>
 </td>
  </tr>
</table>
예제 #10
0
?>
<h1><?php 
echo UserModule::t('Manage Profile Fields');
?>
</h1>
<div class="row white-bg inside-block">
<div class="col-md-12">
<p><?php 
echo UserModule::t("You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.");
?>
</p>
</div>
<div class="col-md-12">
<?php 
echo CHtml::link(UserModule::t('Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
//	$this->renderPartial('_search',array(
//		'model'=>$model,
//	));
?>
</div><!-- search-form -->
</div>
<div class="col-md-12">
<?php 
$this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $dataProvider, 'columns' => array('id', array('name' => UserModule::t('varname'), 'type' => 'raw', 'value' => 'UHtml::markSearch($data,"varname")'), array('name' => UserModule::t('title'), 'value' => 'UserModule::t($data->title)'), array('name' => UserModule::t('field_type'), 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'field_size', array('name' => UserModule::t('required'), 'value' => 'ProfileField::itemAlias("required",$data->required)', 'filter' => ProfileField::itemAlias("required")), 'position', array('name' => UserModule::t('visible'), 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), array('name' => 'paymentProps', 'value' => '$data->paymentProps'), array('class' => 'CButtonColumn'))));
?>
</div>
</div>
예제 #11
0
파일: admin.php 프로젝트: phiphi1992/fpthue
<?php

$this->breadcrumbs = array(UserModule::t('Profile Fields') => array('admin'), UserModule::t('Manage'));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n    \$('.search-form').toggle();\n    return false;\n});\n\$('.search-form form').submit(function(){\n    \$.fn.yiiGridView.update('profile-field-grid', {\n        data: \$(this).serialize()\n    });\n    return false;\n});\n");
?>
<ul class="breadcrumb" id="breadcrumb">
	<li><span class="badge badge-success"><strong><?php 
echo UserModule::t('Manage Profile Fields');
?>
</strong></span></li>
</ul>

<p><?php 
echo UserModule::t("You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.");
?>
</p>

<?php 
echo CHtml::link(UserModule::t('Advanced Search'), '#', array('class' => 'search-button btn'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'profile-field-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'itemsCssClass' => 'table-default items table table-striped table-bordered', 'columns' => array(array('name' => 'id', 'type' => 'raw', 'value' => '$data->id', 'htmlOptions' => array('style' => 'width:50px')), array('name' => 'varname', 'type' => 'raw', 'value' => 'UHtml::markSearch($data,"varname")'), array('name' => 'title', 'value' => 'UserModule::t($data->title)'), array('name' => 'field_type', 'value' => '$data->field_type', 'filter' => ProfileField::itemAlias("field_type")), 'field_size', array('name' => 'required', 'value' => 'ProfileField::itemAlias("required",$data->required)', 'filter' => ProfileField::itemAlias("required")), 'position', array('name' => 'visible', 'value' => 'ProfileField::itemAlias("visible",$data->visible)', 'filter' => ProfileField::itemAlias("visible")), array('class' => 'CButtonColumn', 'htmlOptions' => array('style' => 'width:55px')))));