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


PHP Phprojekt::setCurrentProjectId方法代码示例

本文整理汇总了PHP中Phprojekt::setCurrentProjectId方法的典型用法代码示例。如果您正苦于以下问题:PHP Phprojekt::setCurrentProjectId方法的具体用法?PHP Phprojekt::setCurrentProjectId怎么用?PHP Phprojekt::setCurrentProjectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phprojekt的用法示例。


在下文中一共展示了Phprojekt::setCurrentProjectId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAction

 public function getAction()
 {
     $id = (int) $this->_getParam('id');
     $record = $this->newModelObject();
     if (!empty($id)) {
         $record = $record->find($id);
         Phprojekt::setCurrentProjectId($record->projectId);
     }
     Phprojekt_CompressedSender::send(Zend_Json_Encoder::encode(Phprojekt_Model_Converter::convertModel($record)));
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:10,代码来源:RestController.php

示例2: setFields

 /**
  * Sets a fields definitions for each field.
  *
  * @return void
  */
 public function setFields()
 {
     // password
     $this->fillField('password', 'Password', 'password', 0, 1, array('length' => 50));
     // confirmValue
     $this->fillField('confirmValue', 'Confirm Password', 'password', 0, 2, array('length' => 50));
     // oldValue
     $this->fillField('oldValue', 'Old Password', 'password', 0, 3, array('length' => 50));
     // email
     $this->fillField('email', 'Email', 'text', 0, 4, array('length' => 255));
     // language
     $range = array();
     foreach ($this->_languageRange as $key => $value) {
         $range[] = $this->getRangeValues($key, $value);
     }
     $this->fillField('language', 'Language', 'selectbox', 0, 5, array('range' => $range, 'required' => true, 'default' => 'en'));
     // timeZone
     $range = array();
     foreach ($this->_timeZoneRange as $key => $value) {
         $range[] = $this->getRangeValues($key, $value);
     }
     $this->fillField('timeZone', 'Time zone', 'selectbox', 0, 6, array('range' => $range, 'required' => true, 'default' => '000'));
     // Proxies
     Phprojekt::setCurrentProjectId(IndexController::INVISIBLE_ROOT);
     $user = new Phprojekt_User_User();
     $range = $user->getAllowedUsers();
     // remove ourselves from the proxy list
     $i = 0;
     foreach ($range as $entry) {
         if ((int) $entry['id'] == Phprojekt_Auth::getUserId()) {
             array_splice($range, $i, 1);
             break;
         }
         $i++;
     }
     $this->fillField('proxies', 'Proxies', 'multiplefilteringselectbox', 0, 7, array('range' => $range, 'required' => true));
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:42,代码来源:Setting.php

示例3: setCurrentProjectId

 /**
  * Keep in the session the current project ID.
  *
  * @return void
  */
 public function setCurrentProjectId()
 {
     Phprojekt::setCurrentProjectId(self::INVISIBLE_ROOT);
 }
开发者ID:penSecIT,项目名称:PHProjekt,代码行数:9,代码来源:IndexController.php

示例4: setCurrentProjectId

 /**
  * Keep in the registry the current project id.
  *
  * @return void
  */
 public function setCurrentProjectId()
 {
     $projectId = (int) $this->getRequest()->getParam("nodeId");
     if (empty($projectId)) {
         throw new Phprojekt_PublishedException(self::NODEID_REQUIRED_TEXT);
     } else {
         Phprojekt::setCurrentProjectId($projectId);
     }
 }
开发者ID:joerch,项目名称:PHProjekt,代码行数:14,代码来源:IndexController.php

示例5: jsonDeleteAction

 /**
  * Deletes a certain item.
  *
  * REQUIRES request parameters:
  * <pre>
  *  - integer <b>id</b> id of the item to delete.
  * </pre>
  *
  * The return is a string in JSON format with:
  * <pre>
  *  - type    => 'success' or 'error'.
  *  - message => Success or error message.
  *  - id      => id of the deleted item.
  * </pre>
  *
  * @throws Zend_Controller_Action_Exception On missing or wrong id, or on error in the action delete.
  *
  * @return void
  */
 public function jsonDeleteAction()
 {
     $id = (int) $this->getRequest()->getParam('id');
     if (empty($id)) {
         throw new Zend_Controller_Action_Exception(self::ID_REQUIRED_TEXT, 400);
     }
     $model = $this->getModelObject()->find($id);
     if (empty($model)) {
         throw new Zend_Controller_Action_Exception(self::NOT_FOUND, 404);
     }
     if ($model->hasField('projectId')) {
         Phprojekt::setCurrentProjectId($model->projectId);
     }
     if ($model instanceof Phprojekt_ActiveRecord_Abstract) {
         $tmp = Default_Helpers_Delete::delete($model);
         if ($tmp === false) {
             $message = Phprojekt::getInstance()->translate(self::DELETE_FALSE_TEXT);
             $resultType = 'error';
         } else {
             $message = Phprojekt::getInstance()->translate(self::DELETE_TRUE_TEXT);
             $resultType = 'success';
         }
         $return = array('type' => $resultType, 'message' => $message, 'id' => $id);
         Phprojekt_Converter_Json::echoConvert($return);
     } else {
         throw new Zend_Controller_Action_Exception(self::NOT_FOUND, 404);
     }
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:47,代码来源:IndexController.php


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