function generate_phpbb_version_select($selected = false) { $branches = get_allowed_phpbb_branches(); // Only display if more than one branch is allowed if (sizeof($branches) == 1) { return; } foreach ($branches as $branch => $row) { phpbb::$template->assign_block_vars('phpbb_branches', array('S_IS_SELECTED' => is_array($selected) && in_array($branch, $selected) ? true : false, 'VALUE' => $branch, 'NAME' => $row['name'])); } }
/** * Create a select with the phpBB branches. * * @param array|bool $selected Array of selected branches. Defaults to false. * @param array|bool $branches Array of branches to output. Defaults to false. * @return void */ public function generate_phpbb_version_select($selected = false, $branches = false) { if (!$branches) { $branches = get_allowed_phpbb_branches(); } foreach ($branches as $branch => $row) { $this->template->assign_block_vars('phpbb_branches', array('S_IS_SELECTED' => is_array($selected) && in_array($branch, $selected) ? true : false, 'VALUE' => $branch, 'NAME' => $row['name'])); } }
/*if (empty($revision_phpbb_versions)) { $error[] = phpbb::$user->lang['MUST_SELECT_ONE_VERSION']; } else { foreach ($revision_phpbb_versions as $revision_phpbb_version) { if (!$revision_phpbb_version || strlen($revision_phpbb_version) < 5 || $revision_phpbb_version[1] != '.' || $revision_phpbb_version[3] != '.') { $error[] = sprintf(phpbb::$user->lang['BAD_VERSION_SELECTED'], $revision_phpbb_version); } } }*/ // phpBB branches $allowed_branches = array_keys(get_allowed_phpbb_branches()); if (sizeof($allowed_branches) == 1) { $selected_branches = $allowed_branches; } else { $selected_branches = request_var('phpbb_branch', array(0)); $selected_branches = array_intersect($selected_branches, $allowed_branches); if (!sizeof($selected_branches)) { $error[] = phpbb::$user->lang['NO_PHPBB_BRANCH']; } } // Send the file to the type class so it can do custom error checks if ($revision_attachment->uploaded) { $error = array_merge($error, titania_types::$types[titania::$contrib->contrib_type]->upload_check($revision_attachment)); } if (!sizeof($error)) { // Success, create a new revision to start