/** * This is the main function that is called on every click action and based on the argument * respective functions are called * * @param $args array this array contains the arguments of the url * * @static * @access public */ function invoke($args) { require_once 'CRM/Core/I18n.php'; require_once 'CRM/Utils/Wrapper.php'; require_once 'CRM/Core/Action.php'; require_once 'CRM/Utils/Request.php'; if ($args[0] !== 'civicrm') { return; } $config =& CRM_Core_Config::singleton(); // also initialize the i18n framework $i18n =& CRM_Core_I18n::singleton(); if ($config->userFramework == 'Mambo') { require_once 'CRM/Core/Mambo.php'; CRM_Core_Mambo::sidebarLeft(); } switch ($args[1]) { case 'contact': CRM_Core_Invoke::contact($args); break; case 'admin': CRM_Core_Invoke::admin($args); break; case 'history': CRM_Core_Invoke::history($args); break; case 'group': CRM_Core_Invoke::group($args); break; case 'import': CRM_Core_Invoke::import($args); break; case 'export': CRM_Core_Invoke::export($args); break; case 'activity': CRM_Core_Invoke::activity($args); break; case 'profile': CRM_Core_Invoke::profile($args); break; case 'server': CRM_Core_Invoke::server($args); break; case 'mailing': require_once 'CRM/Mailing/Invoke.php'; CRM_Mailing_Invoke::main($args); break; case 'contribute': require_once 'CRM/Contribute/Invoke.php'; CRM_Contribute_Invoke::main($args); break; default: CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/search/basic', 'reset=1')); break; } return; }