/** * Compose a new url string from the current url string * Used by all the framework components, specifically, * pager, sort and qfc * * @param string $urlVar the url variable being considered (i.e. crmPageID, crmSortID etc) * * @return string the url fragment * @access public */ static function makeURL($urlVar, $includeReset = false, $includeForce = true) { $config = CRM_Core_Config::singleton(); if (!isset($_GET[$config->userFrameworkURLVar])) { return ''; } return self::url($_GET[$config->userFrameworkURLVar], CRM_Utils_System::getLinksUrl($urlVar, $includeReset, $includeForce)); }
/** * Compose a new URL string from the current URL string. * * Used by all the framework components, specifically, * pager, sort and qfc * * @param string $urlVar * The url variable being considered (i.e. crmPageID, crmSortID etc). * @param bool $includeReset * (optional) Whether to include the reset GET string (if present). * @param bool $includeForce * (optional) Whether to include the force GET string (if present). * @param string $path * (optional) The path to use for the new url. * @param bool|string $absolute * (optional) Whether to return an absolute URL. * * @return string * The URL fragment. */ public static function makeURL($urlVar, $includeReset = FALSE, $includeForce = TRUE, $path = NULL, $absolute = FALSE) { if (empty($path)) { $config = CRM_Core_Config::singleton(); $path = CRM_Utils_Array::value($config->userFrameworkURLVar, $_GET); if (empty($path)) { return ''; } } return self::url($path, CRM_Utils_System::getLinksUrl($urlVar, $includeReset, $includeForce), $absolute); }
/** * Set the post action values for the block. * * php is lame and u cannot call functions from static initializers * hence this hack * * @param int $id * * @return void */ private static function setTemplateValues($id) { switch ($id) { case self::CREATE_NEW: self::setTemplateShortcutValues(); break; case self::DASHBOARD: self::setTemplateDashboardValues(); break; case self::ADD: $defaultLocation = CRM_Core_BAO_LocationType::getDefault(); $defaultPrimaryLocationId = $defaultLocation->id; $values = array('postURL' => CRM_Utils_System::url('civicrm/contact/add', 'reset=1&ct=Individual'), 'primaryLocationType' => $defaultPrimaryLocationId); foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) { $values[$greeting . '_id'] = CRM_Contact_BAO_Contact_Utils::defaultGreeting('Individual', $greeting); } self::setProperty(self::ADD, 'templateValues', $values); break; case self::LANGSWITCH: // gives the currentPath without trailing empty lcMessages to be completed $values = array('queryString' => CRM_Utils_System::getLinksUrl('lcMessages', TRUE, FALSE, FALSE)); self::setProperty(self::LANGSWITCH, 'templateValues', $values); break; case self::FULLTEXT_SEARCH: $urlArray = array('fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', 'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name')); self::setProperty(self::FULLTEXT_SEARCH, 'templateValues', $urlArray); break; case self::RECENTLY_VIEWED: $recent = CRM_Utils_Recent::get(); self::setProperty(self::RECENTLY_VIEWED, 'templateValues', array('recentlyViewed' => $recent)); break; case self::EVENT: self::setTemplateEventValues(); break; } }
/** * @return string */ public function getCurrentLocation() { $config = CRM_Core_Config::singleton(); $path = CRM_Utils_Array::value($config->userFrameworkURLVar, $_GET); return CRM_Utils_System::url($path, CRM_Utils_System::getLinksUrl(self::PAGE_ID, FALSE, TRUE), FALSE, NULL, FALSE) . $this->getCurrentPageID(); }
/** * Compose a new url string from the current url string * Used by all the framework components, specifically, * pager, sort and qfc * * @param string $urlVar the url variable being considered (i.e. crmPageID, crmSortID etc) * * @return string the url fragment * @access public */ function makeURL($urlVar) { $config =& CRM_Core_Config::singleton(); return CRM_Utils_System::url($_GET[$config->userFrameworkURLVar], CRM_Utils_System::getLinksUrl($urlVar)); }