选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
查看 CommunityForm.class.php - 文件管理器
👁 查看:CommunityForm.class.php
路径:/virtual/bigbrother/sns/lib/form/CommunityForm.class.php
大小:2.18 KB · 修改:2010-08-10 13:59:42 · 权限:0644 · 可写
<?php

/**
 * This file is part of the OpenPNE package.
 * (c) OpenPNE Project (http://www.openpne.jp/)
 *
 * For the full copyright and license information, please view the LICENSE
 * file and the NOTICE file that were distributed with this source code.
 */

/**
 * Community form.
 *
 * @package    OpenPNE
 * @subpackage form
 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
 */
class CommunityForm extends BaseCommunityForm
{
  protected $configForm;

  public function configure()
  {
    unset($this['created_at'], $this['updated_at'], $this['file_id']);
    unset($this->widgetSchema['id']);

    $this->setValidator('name', new opValidatorString(array('max_length' => 64, 'trim' => true)));

    $c = new Criteria();
    if (1 != sfContext::getInstance()->getUser()->getMemberId())
    {
      $c->add(CommunityCategoryPeer::IS_ALLOW_MEMBER_COMMUNITY, 1);
    }
    $this->setWidget('community_category_id', new sfWidgetFormPropelChoice(array(
      'model'       => 'CommunityCategory',
      'add_empty'   => false,
      'peer_method' => 'retrieveAllChildren',
      'criteria'    => $c,
    )));
    $this->widgetSchema->setLabel('community_category_id', 'Community Category');
    $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('form_community');

    $this->mergePostValidator(new sfValidatorCallback(array('callback' => array($this, 'checkCreatable'))));
  }

  public function updateObject($values = null)
  {
    $object = parent::updateObject($values);

    $this->saveMember($object);

    return $object;
  }

  public function saveMember(Community $community)
  {
    if ($this->isNew())
    {
      $member = new CommunityMember();
      $member->setPosition('admin');
      $member->setMemberId(sfContext::getInstance()->getUser()->getMemberId());
      $member->setCommunity($community);
    }
  }

  public function checkCreatable($validator, $value)
  {
    $category = CommunityCategoryPeer::retrieveByPk($value['community_category_id']);
    if ($category->getIsAllowMemberCommunity())
    {
      return $value;
    }

    if (1 == sfContext::getInstance()->getUser()->getMemberId())
    {
      return $value;
    }

    throw new sfValidatorError($validator, 'invalid');
  }
}
ページが見つかりませんでした – Lumiere Shop
ここを指しているリンクに誤りがあったようです。検索してみるのはいかがですか ?
お買い物カゴ