当前位置: 首页>>代码示例>>PHP>>正文


PHP opToolkit::getPresetProfileList方法代码示例

本文整理汇总了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();
 }
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:8,代码来源:Profile.class.php

示例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);
 }
开发者ID:shotaatago,项目名称:OpenPNE3,代码行数:12,代码来源:opPresetProfileForm.class.php

示例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;
 }
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:18,代码来源:ProfileOptionTable.class.php

示例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');
             }
         }
     }
 }
开发者ID:nise-nabe,项目名称:ppcon-sns,代码行数:27,代码来源:MemberProfileForm.class.php

示例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.');
             }
         }
     }
 }
开发者ID:newZinc,项目名称:OpenPNE3,代码行数:32,代码来源:MemberProfileForm.class.php

示例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;
开发者ID:te-koyama,项目名称:openpne,代码行数:31,代码来源:editSuccess.php


注:本文中的opToolkit::getPresetProfileList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。