當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。