本文整理汇总了PHP中opToolkit::getPresetProfileList方法的典型用法代码示例。如果您正苦于以下问题:PHP opToolkit::getPresetProfileList方法的具体用法?PHP opToolkit::getPresetProfileList怎么用?PHP opToolkit::getPresetProfileList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opToolkit
的用法示例。
在下文中一共展示了opToolkit::getPresetProfileList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPresetConfig
public function getPresetConfig()
{
$list = opToolkit::getPresetProfileList();
if (!empty($list[$this->getRawPresetName()])) {
return $list[$this->getRawPresetName()];
}
return array();
}
示例2: save
public function save($con = null)
{
$values = $this->getValues();
$presetList = opToolkit::getPresetProfileList();
$presetName = $values['preset'];
$preset = $presetList[$presetName];
$values = $this->mergePresetAndValues($preset, $values);
$values['name'] = 'op_preset_' . $values['name'];
unset($values['preset'], $values['choices'], $values['caption']);
$this->values = $values;
parent::save($con);
}
示例3: generatePresetProfileOption
public function generatePresetProfileOption($profileId)
{
$result = array();
$profile = Doctrine::getTable('Profile')->find($profileId);
if (!$profile || !$profile->isPreset()) {
return $result;
}
$list = opToolkit::getPresetProfileList();
if (!empty($list[$profile->getRawPresetName()]['Choices'])) {
foreach ($list[$profile->getRawPresetName()]['Choices'] as $v) {
$option = new opProfileOptionEmulator();
$option->id = $v;
$option->value = $v;
$result[] = $option;
}
}
return $result;
}
示例4: setProfileWidgets
protected function setProfileWidgets($profiles)
{
$presetList = opToolkit::getPresetProfileList();
foreach ($profiles as $profile) {
$profileI18n = $profile->Translation[sfContext::getInstance()->getUser()->getCulture()]->toArray();
$profileWithI18n = $profile->toArray() + $profileI18n;
$widgetOptions = array('widget' => opFormItemGenerator::generateWidget($profileWithI18n, $this->getFormOptionsValue($profile->getId())));
$validatorOptions = array('validator' => opFormItemGenerator::generateValidator($profileWithI18n, $this->getFormOptions($profile->getId())));
if ($profile->getIsEditPublicFlag()) {
$widgetOptions['is_edit_public_flag'] = $validatorOptions['is_edit_public_flag'] = true;
if (!$this->getDefault($profile->getName())) {
$this->setDefault($profile->getName(), array('public_flag' => $profile->getDefaultPublicFlag()));
}
}
$this->widgetSchema[$profile->getName()] = new opWidgetFormProfile($widgetOptions);
$this->validatorSchema[$profile->getName()] = new opValidatorProfile($validatorOptions);
$this->widgetSchema[$profile->getName()]->profile = $profile;
$this->validatorSchema[$profile->getName()]->profile = $profile;
$this->widgetSchema->setHelp($profile->getName(), $profileWithI18n['info']);
if ($profile->isPreset()) {
$this->widgetSchema->setLabel($profile->getName(), $presetList[$profile->getRawPresetName()]['Caption']);
if ('op_preset_self_introduction' === $profile->getName()) {
$this->widgetSchema->setHelp($profile->getName(), 'This Profile supported markdown format');
}
}
}
}
示例5: setProfileWidgets
protected function setProfileWidgets($profiles)
{
$presetList = opToolkit::getPresetProfileList();
foreach ($profiles as $profile) {
if ('mobile_frontend' === sfConfig::get('sf_app')) {
if ('op_preset_country' === $profile->getName() || 'op_preset_region' === $profile->getName()) {
continue;
}
}
$profileI18n = $profile->Translation[sfContext::getInstance()->getUser()->getCulture()]->toArray();
$profileWithI18n = $profile->toArray() + $profileI18n;
$widgetOptions = array('widget' => opFormItemGenerator::generateWidget($profileWithI18n, $this->getFormOptionsValue($profile->getId())));
$validatorOptions = array('validator' => opFormItemGenerator::generateValidator($profileWithI18n, $this->getFormOptions($profile->getId())));
if ($profile->getIsEditPublicFlag()) {
$widgetOptions['is_edit_public_flag'] = $validatorOptions['is_edit_public_flag'] = true;
if (!$this->getDefault($profile->getName())) {
$this->setDefault($profile->getName(), array('public_flag' => $profile->getDefaultPublicFlag()));
}
}
$this->widgetSchema[$profile->getName()] = new opWidgetFormProfile($widgetOptions);
$this->validatorSchema[$profile->getName()] = new opValidatorProfile($validatorOptions);
$this->widgetSchema[$profile->getName()]->profile = $profile;
$this->validatorSchema[$profile->getName()]->profile = $profile;
$this->widgetSchema->setHelp($profile->getName(), $profileWithI18n['info']);
if ($profile->isPreset()) {
$this->widgetSchema->setLabel($profile->getName(), $presetList[$profile->getRawPresetName()]['Caption']);
if ('op_preset_birthday' === $profile->getName()) {
$this->widgetSchema->setHelp($profile->getName(), 'The public_flag for your age can be configure at "Settings" page.');
}
}
}
}
示例6: __
echo $presetForm;
?>
</table>
<input type="submit" value="<?php
echo __('Add');
?>
" />
</form>
<?php
} else {
echo __('There is no preset profile.');
}
} else {
?>
<h3><?php
$presetList = opToolkit::getPresetProfileList();
foreach ($presetList as $k => $v) {
if ('op_preset_' . $v['Name'] === $profile['name']) {
echo __($v['Caption']);
break;
}
}
?>
</h3>
<form action="<?php
echo url_for('profile/edit?type=preset&id=' . $profile->getId());
?>
" method="post">
<table style="width: 50%;">
<?php
echo $presetForm;