Exemplo n.º 1
0
 /**
  * Saves a i18n values
  *
  * @param	\ict\data\project\Project	$project
  * @param	string					$columnName
  */
 public function saveI18nValue(Project $project, $columnName)
 {
     if (!I18nHandler::getInstance()->isPlainValue($columnName)) {
         I18nHandler::getInstance()->save($columnName, 'ict.project.project' . $project->projectID . ($columnName == 'title' ? '' : '.' . $columnName), 'ict.project', PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
         // update description
         $projectEditor = new ProjectEditor($project);
         $projectEditor->update(array($columnName => 'ict.project.project' . $project->projectID . ($columnName == 'title' ? '' : '.' . $columnName)));
     }
 }
Exemplo n.º 2
0
 /**
  * @see	\wcf\data\AbstractDatabaseObjectAction::create()
  */
 public function create()
 {
     // prevent the position from being set raw...
     $position = 0;
     if (isset($this->parameters['data']['position'])) {
         $position = $this->parameters['data']['position'];
         unset($this->parameters['data']['position']);
     }
     // ...we have our own method for that
     $project = parent::create();
     $projectEditor = new ProjectEditor($project);
     $projectEditor->setPosition($position);
     return $project;
 }