/** * Short description for 'validVersion' * * Long description (if any) ... * * @param unknown $toolname Parameter description (if any) ... * @param unknown $newversion Parameter description (if any) ... * @param unknown &$error Parameter description (if any) ... * @param integer $required Parameter description (if any) ... * @param integer $result Parameter description (if any) ... * @return integer Return description (if any) ... */ public function validVersion($toolname, $newversion, &$error, $required = 1, $result = 1) { $toolhelper = new \Components\Tools\Helpers\Utils(); if ($required && !$newversion) { // was left blank $result = 0; $error = Lang::txt('ERR_VERSION_BLANK'); } else { if ($toolhelper->check_validInput($newversion)) { // illegal characters $result = 0; $error = Lang::txt('ERR_VERSION_ILLEGAL'); } else { if ($required) { $this->getToolVersions('', $versions, $toolname, 1); if ($versions) { foreach ($versions as $t) { if (strtolower($t->version) == strtolower($newversion)) { $result = 0; $error = Lang::txt('ERR_VERSION_EXISTS'); } } } } } } return $result; }
/** * Get a list of team members * * @param array $new Parameter description (if any) ... * @param unknown $id Parameter description (if any) ... * @param object $database JDatabase * @param string &$err Error message * @return array */ public function writeTeam($new, $id, $database, &$err = '') { $toolhelper = new \Components\Tools\Helpers\Utils(); $members = is_array($new) ? $new : $toolhelper->makeArray($new); $teamlist = array(); $invalid = ''; $i = 0; if (count($members) > 0) { foreach ($members as $member) { $user = User::getInstance($member); if (is_object($user)) { if ($id) { $teamlist[$i]->uidNumber = $user->get('id'); } else { $teamlist[$i] = $user->get('id'); } $i++; } else { $err = Lang::txt('CONTRIBTOOL_ERROR_LOGIN_DOES_NOT_EXIST'); $invalid .= ' ' . $member . ';'; } } } if ($err) { $err .= $invalid; } return $teamlist; }