本文整理汇总了PHP中CATSUtility::transferRelativeURI方法的典型用法代码示例。如果您正苦于以下问题:PHP CATSUtility::transferRelativeURI方法的具体用法?PHP CATSUtility::transferRelativeURI怎么用?PHP CATSUtility::transferRelativeURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CATSUtility
的用法示例。
在下文中一共展示了CATSUtility::transferRelativeURI方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onDeleteAttachment
private function onDeleteAttachment()
{
if ($this->_accessLevel < ACCESS_LEVEL_DELETE) {
$this->listByView('Invalid user level for action.');
return;
}
/* Bail out if we don't have a valid attachment ID. */
if (!$this->isRequiredIDValid('attachmentID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid attachment ID.');
}
/* Bail out if we don't have a valid joborder ID. */
if (!$this->isRequiredIDValid('companyID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid company ID.');
}
$companyID = $_GET['companyID'];
$attachmentID = $_GET['attachmentID'];
if (!eval(Hooks::get('CLIENTS_ON_DELETE_ATTACHMENT_PRE'))) {
return;
}
$attachments = new Attachments($this->_siteID);
$attachments->delete($attachmentID);
if (!eval(Hooks::get('CLIENTS_ON_DELETE_ATTACHMENT_POST'))) {
return;
}
CATSUtility::transferRelativeURI('m=companies&a=show&companyID=' . $companyID);
}
示例2: urlencode
$URI = 'm=login';
/* Local demo account doesn't relogin. */
if (!empty($unixName) && $unixName != 'demo') {
$URI .= '&s=' . $unixName;
}
if (isset($_GET['message'])) {
$URI .= '&message=' . urlencode($_GET['message']);
}
if (isset($_GET['messageSuccess'])) {
$URI .= '&messageSuccess=' . urlencode($_GET['messageSuccess']);
}
/* catsone.com demo domain doesn't relogin. */
if (strpos(CATSUtility::getIndexName(), '://demo.catsone.com') !== false) {
CATSUtility::transferURL('http://www.catsone.com');
} else {
CATSUtility::transferRelativeURI($URI);
}
} else {
if (!ModuleUtility::moduleRequiresAuthentication($_GET['m'])) {
/* No authentication required; load the module. */
ModuleUtility::loadModule($_GET['m']);
} else {
if (!$_SESSION['CATS']->isLoggedIn()) {
/* User isn't logged in and authentication is required; send the user
* to the login page.
*/
ModuleUtility::loadModule('login');
} else {
/* Everything's good; load the requested module. */
$_SESSION['CATS']->logPageView();
ModuleUtility::loadModule($_GET['m']);
示例3: importBulkResumes
private function importBulkResumes()
{
if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
CommonErrors::fatal(COMMONERROR_NOTLOGGEDIN, $this);
}
if ($_SESSION['CATS']->getAccessLevel() < ACCESS_LEVEL_SA) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
}
$uploadPath = FileUtility::getUploadPath($this->_siteID, 'massimport');
$attachments = new Attachments($this->_siteID);
$bulkResumes = $attachments->getBulkAttachments();
if (!count($bulkResumes)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this);
}
/**
* Write the parsed resume contents to the new file which will
* be created as a text document for each bulk attachment.
*/
foreach ($bulkResumes as $bulkResume) {
$fullName = $bulkResume['originalFileName'];
if (!strlen(trim($fullName))) {
$fullName = 'Untitled';
}
$mp = explode('.', $fullName);
$fileName = implode('.', array_slice($mp, 0, -1));
if (!@file_exists($newFileName = $uploadPath . '/_BulkResume_' . $fileName . '.txt')) {
// Some old files are fulltext encoded which makes them a pain for the parser, fixing here:
$contents = DatabaseSearch::fulltextDecode($bulkResume['text']);
@file_put_contents($newFileName, $contents);
chmod($newFileName, 0777);
}
}
CATSUtility::transferRelativeURI('m=import&a=massImport&step=2');
}
示例4: careerPortalQuestionnaireUpdate
public function careerPortalQuestionnaireUpdate()
{
if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
return;
}
$questionnaire = new Questionnaire($this->_siteID);
$data = $questionnaire->getAll(true);
for ($i = 0; $i < count($data); $i++) {
if (isset($_POST[$id = 'removeQuestionnaire' . $i]) && !strcasecmp($_POST[$id], 'yes')) {
$questionnaire->delete($data[$i]['questionnaireID']);
}
}
CATSUtility::transferRelativeURI('m=settings&a=careerPortalSettings');
}
示例5: getWebForm
//.........这里部分代码省略.........
return $this->getException('There was an error saving your changes', 'An unexpected error has occured when trying to make the changes ' . 'you made permanent. An administrator has been contacted and ' . 'the problem will be looked into shortly. We appologize for the ' . 'inconvenience.');
} else {
$updatedRows += mysql_affected_rows();
if ($addRecord && $callBackPrimaryKey) {
$row[$callBackPrimaryKey] = mysql_insert_id();
}
if ($callBack) {
$callBack($row);
}
}
}
}
if ($updatedRows > 0) {
if ($addRecord) {
$infoHtml .= "<div id=\"cpInfo\" class=\"cpInfo\">\n";
$infoHtml .= "<span class=\"cpInfoHeaderText\">You have added a record.</span>\n<br />";
$infoHtml .= "<b>Do not</b> refresh this page as it may result in a duplicate submission.";
$infoHtml .= "</div>\n";
$infoHtml .= sprintf('<form method="get" action="%s" name="cpBack">', substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?')));
foreach ($_GET as $name => $value) {
if (!strcmp($name, 'cpPageState')) {
$infoHtml .= sprintf('<input type="hidden" name="cpPageState" value="%d" />', CPPS_LISTVIEW);
} else {
if (!strcmp($name, 'a') || !strcmp($name, 'm') || !strcmp($name, 'siteID')) {
$infoHtml .= sprintf('<input type="hidden" name="%s" value="%s" />', htmlspecialchars($name), htmlspecialchars($value));
}
}
}
$infoHtml .= '</form>';
$infoHtml .= '<img src="images/cp_back.gif" border="0" style="cursor: pointer;" alt="<-- Back to List" onclick="document.cpBack.submit();" />';
return $infoHtml;
} else {
$src = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
CATSUtility::transferRelativeURI($src . '&cpChangesMade=1');
}
}
}
}
if (isset($_GET['cpChangesMade']) && $_GET['cpChangesMade'] == '1') {
$infoHtml .= "<div id=\"cpInfo\" class=\"cpInfo\" style=\"position: absolute; top: 150px; left: 150px; width: 600px; background-color: white;\">\n";
$infoHtml .= "<span class=\"cpInfoHeaderText\">Your changes have been saved.</span>\n";
$infoHtml .= "</div>\n";
$infoHtml .= "<script type=\"text/javascript\">\n";
$infoHtml .= "var cpInfoHide = window.setTimeout('var obj = document.getElementById(\"cpInfo\"); if (obj) { obj.style.display = \"none\"; }', 2000);\n</script>\n";
}
foreach ($this->_sections as $sectionName => $sectionData) {
if ($sectionName != CP_LISTVIEW) {
$sectionFields = '';
$prefillData = array();
foreach ($this->_tables as $tableName => $tableData) {
foreach ($tableData['fields'] as $fieldName => $fieldData) {
if (isset($fieldData['section']) && in_array($sectionName, $fieldData['section'])) {
if ($sectionFields != '') {
$sectionFields .= '[NL]';
}
$sectionFields .= sprintf('[%s]', $fieldData['uniqueID']);
if (!$addRecord) {
// prefill the field with existing data for edits
$rawData = $this->getFieldInputText($fieldData, $row[$fieldData['uniqueID']], '');
$prefillData[$fieldData['uniqueID']] = $rawData;
}
}
}
}
if (!$addRecord) {
$this->_wf->setValidatedFields($prefillData);
示例6: onDelete
private function onDelete()
{
if ($this->_accessLevel < ACCESS_LEVEL_DELETE) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Invalid user level for action.');
}
/* Bail out if we don't have a valid contact ID. */
if (!$this->isRequiredIDValid('contactID', $_GET)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid contact ID.');
}
$contactID = $_GET['contactID'];
if (!eval(Hooks::get('CONTACTS_DELETE_PRE'))) {
return;
}
$contacts = new Contacts($this->_siteID);
$contacts->delete($contactID);
/* Delete the MRU entry if present. */
$_SESSION['CATS']->getMRU()->removeEntry(DATA_ITEM_CONTACT, $contactID);
if (!eval(Hooks::get('CONTACTS_DELETE_POST'))) {
return;
}
CATSUtility::transferRelativeURI('m=contacts&a=listByView');
}
示例7: onDeleteEvent
public function onDeleteEvent()
{
if ($this->_accessLevel < ACCESS_LEVEL_DELETE)
{
CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Invalid user level for action.');
}
/* Bail out if we don't have a valid event ID. */
if (!$this->isRequiredIDValid('eventID', $_GET))
{
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid event ID.');
}
$eventID = $_GET['eventID'];
if (!eval(Hooks::get('CALENDAR_DELETE_PRE'))) return;
$calendar = new Calendar($this->_siteID);
$calendar->deleteEvent($eventID);
if (!eval(Hooks::get('CALENDAR_DELETE_POST'))) return;
/* Transfer to same url without a=deleteEvent or eventID. */
$newGet = $_GET;
$newParams = array();
unset($newGet['a']);
unset($newGet['eventID']);
foreach ($newGet AS $name => $value)
{
$newParams[] = urlencode($name).'='.urlencode($value);
}
CATSUtility::transferRelativeURI(implode('&', $newParams));
}
示例8: show
public function show()
{
if (!isset($_SESSION['CATS_WIZARD']) || empty($_SESSION['CATS_WIZARD']) ||
!is_array($_SESSION['CATS_WIZARD']))
{
// The user has removed or the session for the wizard has been lost,
// redirect to rebuild it
CATSUtility::transferRelativeURI(CATSUtility::getIndexName() . 'm=home');
return;
}
// Build the javascript for navigation
$js = '';
for ($i=0; $i<count($_SESSION['CATS_WIZARD']['pages']); $i++)
{
$js .= sprintf('addWizardPage("%s", %s, %s);%s',
addslashes($_SESSION['CATS_WIZARD']['pages'][$i]['title']),
$_SESSION['CATS_WIZARD']['pages'][$i]['disableNext'] ? 'true' : 'false',
$_SESSION['CATS_WIZARD']['pages'][$i]['disableSkip'] ? 'true' : 'false',
"\n"
);
}
$js .= sprintf('var finishURL = \'%s\';', $_SESSION['CATS_WIZARD']['finishURL'], "\n");
$js .= sprintf('var currentPage = %d;%s', $_SESSION['CATS_WIZARD']['curPage'], "\n");
$this->_template->assign('js', $js);
if (isset($_SESSION['CATS_WIZARD']['js'])) $jsInclude = $_SESSION['CATS_WIZARD']['js'];
else $jsInclude = '';
$this->_template->assign('jsInclude', $jsInclude);
$this->_template->assign('pages', $_SESSION['CATS_WIZARD']['pages']);
$this->_template->assign('currentPage', $_SESSION['CATS_WIZARD']['pages'][$_SESSION['CATS_WIZARD']['curPage']-1]);
$this->_template->assign('currentPageIndex', $_SESSION['CATS_WIZARD']['curPage']-1);
$this->_template->assign('active', $this);
$this->_template->assign('enableSkip', true);
$this->_template->assign('enablePrevious', $_SESSION['CATS_WIZARD']['curPage']==1 ? false : true);
$this->_template->assign('enableNext', true);
$this->_template->display('./modules/wizard/Show.php');
}
示例9: attemptLogin
//.........这里部分代码省略.........
}
$systemInfoDb = new SystemInfo();
$accessLevel = $_SESSION['CATS']->getAccessLevel();
$mailerSettings = new MailerSettings($_SESSION['CATS']->getSiteID());
$mailerSettingsRS = $mailerSettings->getAll();
/***************************** BEGIN NEW WIZARD *****************************************/
/**
* Improved setup wizard using the Wizard library. If the user succeeds,
* all old-style wizards will no longer be shown.
*/
$wizard = new Wizard(CATSUtility::getIndexName() . '?m=home', './js/wizardIntro.js');
if ($_SESSION['CATS']->isFirstTimeSetup()) {
$wizard->addPage('Welcome!', './modules/login/wizard/Intro.tpl', '', false, true);
}
if (!$_SESSION['CATS']->isAgreedToLicense()) {
$phpeval = '';
if (!eval(Hooks::get('LICENSE_TERMS'))) {
return;
}
$wizard->addPage('License', './modules/login/wizard/License.tpl', $phpeval, true, true);
}
if (!file_exists('modules/asp') || defined('CATS_TEST_MODE') && CATS_TEST_MODE) {
// On-site wizard pages
if (!LicenseUtility::isLicenseValid()) {
if (defined('LICENSE_KEY') && LICENSE_KEY == '') {
$template = 'Register.tpl';
$templateName = 'Register';
} else {
$template = 'Reregister.tpl';
$templateName = 'License Expired';
}
$wizard->addPage($templateName, './modules/login/wizard/' . $template, '', false, true);
}
}
// if logged in for the first time, change password
if (strtolower($username) == 'admin' && $password === DEFAULT_ADMIN_PASSWORD) {
$wizard->addPage('Password', './modules/login/wizard/Password.tpl', '', false, true);
}
// make user set an e-mail address
if (trim($_SESSION['CATS']->getEmail()) == '') {
$wizard->addPage('E-mail', './modules/login/wizard/Email.tpl', '', false, true);
}
// if no site name set, make user set site name
if ($accessLevel >= ACCESS_LEVEL_SA && $_SESSION['CATS']->getSiteName() === 'default_site') {
$wizard->addPage('Site', './modules/login/wizard/SiteName.tpl', '', false, true);
}
// CATS Hosted Wizard Pages
if (!eval(Hooks::get('ASP_WIZARD_PAGES'))) {
return;
}
if ($_SESSION['CATS']->isFirstTimeSetup()) {
$wizard->addPage('Setup Users', './modules/login/wizard/Users.tpl', '
$users = new Users($siteID);
$mp = $users->getAll();
$data = $users->getLicenseData();
$this->_template->assign(\'users\', $mp);
$this->_template->assign(\'totalUsers\', $data[\'totalUsers\']);
$this->_template->assign(\'userLicenses\', $data[\'userLicenses\']);
$this->_template->assign(\'accessLevels\', $users->getAccessLevels());
');
if (!eval(Hooks::get('ASP_WIZARD_IMPORT'))) {
return;
}
}
// The wizard will not display if no pages have been added.
$wizard->doModal();
/******************************* END NEW WIZARD *******************************************/
/* Session is logged in, do we need to send the user to the wizard?
* This should be done only on the first use, indicated by the
* admin user's password still being set to the default.
*/
/* If we have a specific page to go to, go there. */
/* These hooks are for important things, like disabling the site based on criteria. */
if (!eval(Hooks::get('LOGGED_IN'))) {
return;
}
if (isset($_GET['reloginVars'])) {
CATSUtility::transferRelativeURI($_GET['reloginVars']);
}
/* LOGGED_IN_MESSAGES hooks are only for messages which show up on initial login (warnings, etc) */
if (!eval(Hooks::get('LOGGED_IN_MESSAGES'))) {
return;
} else {
if ($accessLevel >= ACCESS_LEVEL_SA && $mailerSettingsRS['configured'] == '0') {
NewVersionCheck::checkForUpdate();
$this->_template->assign('inputType', 'conclusion');
$this->_template->assign('title', 'E-Mail Disabled');
$this->_template->assign('prompt', 'E-mail features are disabled. In order to enable e-mail features (such as e-mail notifications), please configure your e-mail settings by clicking on the Settings tab and then clicking on Administration.');
$this->_template->assign('action', $this->getAction());
$this->_template->assign('home', 'home');
$this->_template->display('./modules/settings/NewInstallWizard.tpl');
} else {
if (!eval(Hooks::get('LOGGED_IN_HOME_PAGE'))) {
return;
}
CATSUtility::transferRelativeURI('m=home');
}
}
}
示例10: onDeleteStaticList
public function onDeleteStaticList()
{
/* Bail out if we don't have a valid type. */
if (!$this->isRequiredIDValid('savedListID', $_GET))
{
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this);
return;
}
$savedListID = $_GET['savedListID'];
$savedLists = new SavedLists($this->_siteID);
/* Write changes. */
$savedLists->delete($savedListID);
CATSUtility::transferRelativeURI('m=lists');
}
示例11: careersPage
//.........这里部分代码省略.........
$candidate['isHot'] ? true : false,
$email1,
$email1,
$candidate['eeoGender'],
$candidate['eeoEthnicType'],
$candidate['eeoVeteranType'],
$candidate['eeoDisabilityStatus']
);
$uploadResume = FileUtility::getUploadFileFromPost($siteID, 'careerportaladd', 'file');
if ($uploadResume !== false)
{
$uploadPath = FileUtility::getUploadFilePath($siteID, 'careerportaladd', $uploadResume);
if ($uploadPath !== false)
{
// Replace most current resume with new uploaded resume
$attachmentsLib->delete($attachmentID, true);
$attachmentCreator = new AttachmentCreator($siteID);
$attachmentCreator->createFromFile(DATA_ITEM_CANDIDATE, $candidate['candidateID'],
$uploadPath, false, '', true, true
);
}
}
// Set the cookie again, since some information used to verify may be changed
$storedVal = '';
foreach ($fieldValues as $tag => $tagData)
{
$storedVal .= sprintf('"%s"="%s"', urlencode($tag), urlencode($tagData));
}
@setcookie($this->getCareerPortalCookieName($siteID), $storedVal, time()+60*60*24*7*2);
$template['Content'] = '<div id="careerContent"><br /><br /><h1>Please wait while you are redirected to your updated profile...</h1></div>';
CATSUtility::transferRelativeURI('m=careers&p=showAll&pa=updateProfile&isPostBack=yes');
}
else if ($p == 'candidateRegistration' && $isRegistrationEnabled)
{
/*$content = $template['Content - Candidate Registration'];
$jobID = intval($_GET['ID']);
$jobOrderData = $jobOrders->get($jobID);
$js = '';
$content = str_replace(array('<applyContent>','</applyContent>'), '', $content);
$content = str_replace('<input-submit>', '<input type="submit" id="submitButton" name="submitButton" value="Continue to Application" />', $content);
$content = str_replace('<input-new>', '<input type="radio" id="isNewYes" name="isNew" value="yes" onchange="isCandidateRegisteredChange();" checked />', $content);
$content = str_replace('<input-registered>', '<input type="radio" id="isNewNo" name="isNew" value="no" onchange="isCandidateRegisteredChange();" />', $content);
$content = str_replace('<input-rememberMe>', '<input type="checkbox" id="rememberMe" name="rememberMe" value="yes" checked />', $content);
$content = str_replace('<title>', $jobOrderData['title'], $content);
// Process html-ish fields like <input-firstName> into the proper form
$content = preg_replace(
'/\<input\-([A-Za-z0-9]+)\>/',
'<input type="text" class="inputBoxNormal" style="width: 270px;" name="$1" id="$1" onfocus="onFocusFormField(this)" />',
$content
);
if (count($fields = $this->getCookieFields($siteID)))
{
$js = '<script language="javascript" type="text/javascript">' . "\n"
. 'function populateSavedFields() { var obj; obj = document.getElementById(\'isNewNo\'); '
. 'if (obj) { obj.checked = true; enableFormFields(true); } ' . "\n";
foreach ($fields as $tagName => $tagValue)
{
$js .= sprintf(
示例12: administrativeHideShow
private function administrativeHideShow()
{
if ($this->_accessLevel < ACCESS_LEVEL_MULTI_SA) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Invalid user level for action.');
}
/* Bail out if we don't have a valid joborder ID. */
if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid Job Order ID.');
}
/* Bail out if we don't have a valid status ID. */
if (!$this->isRequiredIDValid('state', $_GET, true)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid state ID.');
}
$jobOrderID = $_GET['jobOrderID'];
// FIXME: Checkbox?
(bool) ($state = $_GET['state']);
$joborders = new JobOrders($this->_siteID);
$joborders->administrativeHideShow($jobOrderID, $state);
CATSUtility::transferRelativeURI('m=joborders&a=show&jobOrderID=' . $jobOrderID);
}
示例13: addSavedSearch
public function addSavedSearch()
{
if (!isset($_GET['searchID']))
{
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'No search ID specified.');
}
if (!isset($_GET['currentURL']))
{
CommonErrors::fatal(COMMONERROR_BADFIELDS, $this, 'No current URL specified.');
}
$searchID = $_GET['searchID'];
$currentURL = $_GET['currentURL'];
if (!eval(Hooks::get('HOME_ADD_SAVED_SEARCH_PRE'))) return;
$savedSearches = new SavedSearches($this->_siteID);
$savedSearches->save($searchID);
if (!eval(Hooks::get('HOME_ADD_SAVED_SEARCH_POST'))) return;
CATSUtility::transferRelativeURI($currentURL);
}