本文整理汇总了PHP中ProfileField类的典型用法代码示例。如果您正苦于以下问题:PHP ProfileField类的具体用法?PHP ProfileField怎么用?PHP ProfileField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProfileField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
gateKeeper();
$message = NULL;
$user = getLoggedInUser();
$user->profile_complete = true;
$profile_type = $user->profile_type;
$fields = ProfileField::get($profile_type);
foreach ($fields as $key => $field) {
if ($field['required'] == "true" && !getInput($key)) {
$message .= "{$field['label']} cannot be empty.";
}
}
if ($message) {
new SystemMessage($message);
forward("editProfile");
}
foreach ($fields as $key => $field) {
$user->{$key} = getInput($key);
}
$user->save();
new Activity($user->guid, "activity:profile:updated", array($user->getURL(), $user->full_name));
new SystemMessage("Your profile has been updated.");
forward("profile/{$user->guid}");
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:EditProfileActionHandler.php
示例2: findbyPk
/**
* @return $this
*/
public function findbyPk($condition)
{
$primaryKey = ProfileField::primaryKey();
if (isset($primaryKey[0])) {
$condition = [$primaryKey[0] => $condition];
}
return $this->andWhere($condition);
}
开发者ID:marsoltys,项目名称:yii2user,代码行数:11,代码来源:ProfileFieldQuery.php
示例3: attributeLabels
public function attributeLabels()
{
$labels = array('user_id' => Yii::t("UserModule.user", 'User ID'), 'profile_id' => Yii::t("UserModule.user", 'Profile ID'));
$model = ProfileField::model()->forOwner()->findAll();
foreach ($model as $field) {
$labels[$field->varname] = Yii::t("UserModule.user", $field->title);
}
return $labels;
}
开发者ID:reubsc,项目名称:sds,代码行数:9,代码来源:Profile.php
示例4: actionProfile
/**
* Shows a particular model.
*/
public function actionProfile()
{
$model = $this->loadUser();
$attributes = array('username' => array('label' => 'Username', 'value' => $model->username), 'email' => array('label' => 'E-mail', 'value' => $model->email), 'createtime' => array('label' => 'Created at', 'value' => date("d.m.Y H:i:s", $model->createtime)), 'lastvisit' => array('label' => 'Last visited at', 'value' => date("d.m.Y H:i:s", $model->lastvisit)), 'status' => array('label' => 'Status', 'value' => User::itemAlias("UserStatus", $model->status)));
$profileFields = ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach ($profileFields as $field) {
$attributes[$field->varname] = array('label' => UserModule::t($field->title), 'value' => $model->profile->getAttribute($field->varname));
}
}
$this->render('profile', array('attributes' => $attributes));
}
开发者ID:piond,项目名称:new_rsud,代码行数:15,代码来源:ProfileController.php
示例5: actionView
/**
* Displays a particular model.
*/
public function actionView()
{
$model = $this->loadModel();
$attributes = array('id', 'username');
$profileFields = ProfileField::model()->forOwner()->sort()->findAll();
if ($profileFields) {
foreach ($profileFields as $field) {
array_push($attributes, array('label' => UserModule::t($field->title), 'name' => $field->varname, 'type' => 'raw', 'value' => $field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname))));
}
}
array_push($attributes, 'password', 'email', 'activkey', array('name' => 'createtime', 'value' => date("d.m.Y H:i:s", $model->createtime)), array('name' => 'lastvisit', 'value' => $model->lastvisit ? date("d.m.Y H:i:s", $model->lastvisit) : UserModule::t("Not visited")), array('name' => 'superuser', 'value' => User::itemAlias("AdminStatus", $model->superuser)), array('name' => 'status', 'value' => User::itemAlias("UserStatus", $model->status)));
$this->render('view', array('model' => $model, 'attributes' => $attributes));
}
开发者ID:piond,项目名称:new_rsud,代码行数:16,代码来源:AdminController.php
示例6: run
public function run($args)
{
$companies = Company::model()->findAll('frozen=:p', array(':p' => '0'));
foreach ($companies as $company) {
Company::setActive($company);
Yii::app()->language = Company::getLanguage();
User::model()->refreshMetaData();
AuthAssignment::model()->refreshMetaData();
ProfileField::model()->refreshMetaData();
Profile::model()->refreshMetaData();
Zakaz::model()->refreshMetaData();
ZakazParts::model()->refreshMetaData();
Events::model()->refreshMetaData();
Templates::model()->refreshMetaData();
Emails::model()->refreshMetaData();
self::executor();
self::manager();
self::send_deffered_emails();
}
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:20,代码来源:EventsCommand.php
示例7: registerManegeScript
/**
* Register Script
*/
public function registerManegeScript()
{
$basePath = Yii::getPathOfAlias(Yii::app()->getModule('cart')->assetPath);
$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'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==" . CartModule::t('Yes') . ";0==" . CartModule::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=\"\">" . CartModule::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'" . CartModule::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'" . CartModule::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\">" . CartModule::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);
}
开发者ID:boyatomic32,项目名称:yii-cart,代码行数:30,代码来源:CDynamicFieldModel.php
示例8: getFields
public static function getFields()
{
if (self::$regMode) {
if (!self::$_modelReg) {
self::$_modelReg = ProfileField::model()->forRegistration()->findAll();
}
return self::$_modelReg;
} else {
if (!self::$_model) {
self::$_model = ProfileField::model()->forOwner()->findAll();
}
return self::$_model;
}
}
开发者ID:ivarsju,项目名称:yii-user,代码行数:14,代码来源:Profile.php
示例9: getAllVarnames
public static function getAllVarnames()
{
$criteria = new CDbCriteria();
$criteria->compare('field_type', 'LIST');
$list = CHtml::listData(ProjectField::model()->findAll($criteria), 'varname', function ($data) {
return $data->varname . " ({$data->title})";
});
$list = array_merge($list, CHtml::listData(ProfileField::model()->findAll($criteria), 'varname', function ($data) {
return $data->varname . " ({$data->title})";
}));
return $list;
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:12,代码来源:Catalog.php
示例10:
?>
<?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();
?>
开发者ID:brettbrusda,项目名称:chat,代码行数:31,代码来源:_form.php
示例11: array
<?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><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></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'))));
开发者ID:yinhe,项目名称:yincart,代码行数:27,代码来源:admin.php
示例12: array
<?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><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></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'))));
开发者ID:sjnlabs2013,项目名称:sampleyii,代码行数:28,代码来源:admin.php
示例13: array
?>
<?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();
开发者ID:alsvader,项目名称:hackbanero,代码行数:31,代码来源:_search.php
示例14: getFields
public function getFields()
{
if ($this->regMode) {
if (!$this->_modelReg) {
$criteria = new CDbCriteria();
$criteria->order = 'position';
if ($this->regType == 'Author') {
$criteria->addInCondition('visible', array(2, 3));
$this->_modelReg = ProfileField::model()->findAll($criteria);
} elseif ($this->regType == 'Customer') {
$criteria->addInCondition('visible', array(1, 3));
$this->_modelReg = ProfileField::model()->findAll($criteria);
}
}
return $this->_modelReg;
} else {
if (!$this->_model) {
$criteria = new CDbCriteria();
$criteria->order = 'position';
if (User::model()->isCustomer()) {
$criteria->addInCondition('visible', array(1, 3));
$this->_model = ProfileField::model()->findAll($criteria);
} elseif (User::model()->isAuthor()) {
$criteria->addInCondition('visible', array(2, 3));
$this->_model = ProfileField::model()->findAll($criteria);
} elseif (User::model()->isManager()) {
$this->_model = ProfileField::model()->findAll();
} else {
$this->_model = ProfileField::model()->forAll()->findAll();
}
}
return $this->_model;
}
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:34,代码来源:Profile.php
示例15: array
$specials2 = true;
}
}
if ($specials2) {
if (isset($data->zakaz->catalog_specials2)) {
return $data->zakaz->catalog_specials2->cat_name;
}
} else {
return false;
}
}), array('name' => 'manager', 'type' => 'raw', 'value' => function ($data) {
return CHtml::link($data->manager, array('/user/admin/view', 'id' => $data->profileManager->id));
}), array('name' => 'user', 'type' => 'raw', 'value' => function ($data) {
return CHtml::link($data->user, array('/user/admin/view', 'id' => $data->profileUser->id));
}), array('name' => 'profileUser.AuthAssignment.AuthItem.description'), array('name' => 'summ', 'footer' => $model->pageTotal($provider)), array('header' => Yii::t('site', 'Payment method'), 'type' => 'raw', 'value' => function ($data) {
$payFields = ProfileField::model()->findAllByAttributes(array('paymentProps' => '1'));
$payFieldsUser = $data->profileUser;
foreach ($payFields as $field) {
$fields[] = $field->varname;
$final[$field->varname] = $field->title;
}
$fields = implode($fields, ',');
$userPayFields = Profile::model()->find(array('select' => $fields, 'condition' => 'user_id = :user', 'params' => array(':user' => $data->profileUser->id)));
$fields = array();
if (!empty($userPayFields)) {
foreach ($userPayFields as $key => $field) {
if ($field != null) {
$fields[$key] = $final[$key];
}
}
}
开发者ID:akoch-ov,项目名称:dipstart-development,代码行数:31,代码来源:admin.php
示例16: array
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>
开发者ID:alsvader,项目名称:hackbanero,代码行数:31,代码来源:_form.php
示例17: getProfileFields
/**
* Returns all profile fields with user data by given category
*
* @todo Optimize me
* @param ProfileFieldCategory $category
* @return Array ProfileFields
*/
public function getProfileFields(ProfileFieldCategory $category = null)
{
$fields = array();
$criteria = new CDbCriteria();
if ($category !== null) {
$criteria->condition = "profile_field_category_id=:catId AND ";
$criteria->params = array(':catId' => $category->id);
}
$criteria->condition .= "visible = 1";
$criteria->order = "sort_order";
foreach (ProfileField::model()->findAll($criteria) as $field) {
if ($field->getUserValue($this->user) != "") {
$fields[] = $field;
}
}
return $fields;
}
开发者ID:alefernie,项目名称:intranet,代码行数:24,代码来源:Profile.php
示例18: operator
<p><?php
echo UserModule::t("You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></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);
});
开发者ID:rizkyramadhan,项目名称:yii-user,代码行数:31,代码来源:admin.php
示例19: ProfileField
$field->title = 'MySpace URL';
$field->sort_order = 800;
$field->profile_field_category_id = $cSocial->id;
$field->field_type_class = 'ProfileFieldTypeText';
$field->is_system = true;
if ($field->save()) {
$field->fieldType->validator = 'url';
$field->fieldType->save();
}
$field = new ProfileField();
$field->internal_name = "url_googleplus";
$field->title = 'Google+ URL';
$field->sort_order = 900;
$field->profile_field_category_id = $cSocial->id;
$field->field_type_class = 'ProfileFieldTypeText';
$field->is_system = true;
if ($field->save()) {
$field->fieldType->validator = 'url';
$field->fieldType->save();
}
$field = new ProfileField();
$field->internal_name = "url_twitter";
$field->title = 'Twitter URL';
$field->sort_order = 1000;
$field->profile_field_category_id = $cSocial->id;
$field->field_type_class = 'ProfileFieldTypeText';
$field->is_system = true;
if ($field->save()) {
$field->fieldType->validator = 'url';
$field->fieldType->save();
}
开发者ID:alefernie,项目名称:intranet,代码行数:31,代码来源:init.php
示例20: array
<?php
//Yii::app()->getClientScript()->registerCssFile(Yii::app()->theme->baseUrl.'/css/manager.css');
?>
<div class="row white-block">
<?php
/* @var $this CategoriesController */
/* @var $dataProvider CActiveDataProvider */
//$this->breadcrumbs=array(
// Yii::t('site','Catalog'),
//);
$this->menu = array(array('label' => Yii::t('site', 'Catalog'), 'url' => array('create')), array('label' => Yii::t('site', 'Manage Catalog'), 'url' => array('admin')));
?>
<h1><?echo Yii::t('site','Catalog');?></h1>
<?php
$criteria = new CDbCriteria();
$criteria->compare('field_type', 'LIST');
$list = CHtml::listData(ProjectField::model()->findAll($criteria), 'varname', 'title');
$list = array_merge($list, CHtml::listData(ProfileField::model()->findAll($criteria), 'varname', 'title'));
echo CHtml::link(CHtml::encode('All'), array('index')) . ' ';
foreach ($list as $key => $value) {
echo CHtml::link(CHtml::encode($value), array('index', 'field_varname' => $key)) . ' ';
}
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
?>
</div>
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:28,代码来源:index.php
注:本文中的ProfileField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论