/**
 * Given one of: ( page, title, text ) parameters, generates
 * an HTML link to documentation.
 *
 * @param array  $params the function params
 * @param object $smarty reference to the smarty object
 *
 * @return string HTML code of a link to documentation
 * @access public
 */
function smarty_function_docURL($params, &$smarty)
{
    if (!isset($smarty)) {
        return;
    } else {
        return CRM_Utils_System::docURL($params);
    }
}
/**
 * Given one of: ( page, title, text ) parameters, generates
 * an HTML link to documentation.
 *
 * @param array  $params the function params
 * @param object $smarty reference to the smarty object 
 *
 * @return string HTML code of a link to documentation
 * @access public
 */
function smarty_function_docURL($params, &$smarty)
{
    if (!isset($smarty)) {
        return;
    } else {
        require_once 'CRM/Utils/System.php';
        return CRM_Utils_System::docURL($params);
    }
}
示例#3
0
 /**
  * Checks if cron has run in a reasonable amount of time
  * @return array
  */
 public function checkLastCron()
 {
     $messages = array();
     $statusPreference = new CRM_Core_DAO_StatusPreference();
     $statusPreference->domain_id = CRM_Core_Config::domainID();
     $statusPreference->name = 'checkLastCron';
     if ($statusPreference->find(TRUE) && !empty($statusPreference->check_info)) {
         $lastCron = $statusPreference->check_info;
         $msg = ts('Last cron run at %1.', array(1 => CRM_Utils_Date::customFormat(date('c', $lastCron))));
     } else {
         $lastCron = 0;
         $msg = ts('No cron runs have been recorded.');
     }
     if ($lastCron > gmdate('U') - 3600) {
         $messages[] = new CRM_Utils_Check_Message(__FUNCTION__, $msg, ts('Cron Running OK'), \Psr\Log\LogLevel::INFO, 'fa-clock-o');
     } else {
         $message = new CRM_Utils_Check_Message(__FUNCTION__, $msg, ts('Cron Not Running'), $lastCron > gmdate('U') - 86400 ? \Psr\Log\LogLevel::WARNING : \Psr\Log\LogLevel::ERROR, 'fa-clock-o');
         $docUrl = 'target="_blank" href="' . CRM_Utils_System::docURL(array('resource' => 'wiki', 'page' => 'Managing Scheduled Jobs', 'URLonly' => TRUE)) . '""';
         $message->addHelp(ts('Configuring cron on your server is necessary for running scheduled jobs such as sending mail and scheduled reminders.') . '<br />' . ts("Learn more in the <a %1>online documentation</a>.", array(1 => $docUrl)));
         $messages[] = $message;
     }
     return $messages;
 }