当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Utils_System::theme方法代码示例

本文整理汇总了PHP中CRM_Utils_System::theme方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::theme方法的具体用法?PHP CRM_Utils_System::theme怎么用?PHP CRM_Utils_System::theme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Utils_System的用法示例。


在下文中一共展示了CRM_Utils_System::theme方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cleanup425

 public function cleanup425()
 {
     $rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
     $template = CRM_Core_Smarty::singleton();
     $columnHeaders = array("Contact ID", "ContributionID", "Contribution Status", "MembershipID", "Membership Type", "Start Date", "End Date", "Membership Status", "Action");
     $template->assign('columnHeaders', $columnHeaders);
     $template->assign('rows', $rows);
     $preMessage = !empty($rows) ? ts('The following records have been processed. Membership records with action = Un-linked have been disconnected from the listed contribution record:') : ts('Could not find any records to process.');
     $template->assign('preMessage', $preMessage);
     $postMessage = ts('You can <a href="%1">click here</a> to try running the 4.2 upgrade script again. <a href="%2" target="_blank">(Review upgrade documentation)</a>', array(1 => CRM_Utils_System::url('civicrm/upgrade', 'reset=1'), 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades'));
     $template->assign('postMessage', $postMessage);
     $content = $template->fetch('CRM/common/upgradeCleanup.tpl');
     echo CRM_Utils_System::theme($content, FALSE, TRUE);
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:14,代码来源:Cleanup.php

示例2: run

 /**
  *
  * POST Param 'qrid': string, usually the name of the queue
  */
 function run()
 {
     $qrid = CRM_Utils_Request::retrieve('qrid', 'String', $this, TRUE);
     $runner = CRM_Queue_Runner::instance($qrid);
     // dpm(array( 'action' => 'CRM_Queue_Page_Runner::run()', 'session' => $_SESSION, 'runner' => $runner, 'qrid' => $qrid ));
     if (!is_object($runner)) {
         CRM_Core_Error::fatal('Queue runner must be configured before execution.');
     }
     CRM_Utils_System::setTitle($runner->title);
     $this->assign('queueRunnerData', array('qrid' => $runner->qrid, 'runNextAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/runNext', NULL, FALSE, NULL, FALSE), 'skipNextAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/skipNext', NULL, FALSE, NULL, FALSE), 'onEndAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/onEnd', NULL, FALSE, NULL, FALSE), 'completed' => 0, 'numberOfItems' => $runner->queue->numberOfItems(), 'buttons' => $runner->buttons));
     if ($runner->isMinimal) {
         $smarty = CRM_Core_Smarty::singleton();
         $content = $smarty->fetch('CRM/Queue/Page/Runner.tpl');
         echo CRM_Utils_System::theme('page', $content, TRUE, $this->_print, FALSE, TRUE);
     } else {
         parent::run();
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:22,代码来源:Runner.php

示例3: run

 /**
  *
  * POST Param 'qrid': string, usually the name of the queue
  */
 public function run()
 {
     $qrid = CRM_Utils_Request::retrieve('qrid', 'String', $this, TRUE);
     $runner = CRM_Queue_Runner::instance($qrid);
     if (!is_object($runner)) {
         CRM_Core_Error::fatal('Queue runner must be configured before execution.');
     }
     CRM_Utils_System::setTitle($runner->title);
     $this->assign('queueRunnerData', array('qrid' => $runner->qrid, 'runNextAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/runNext', NULL, FALSE, NULL, FALSE), 'skipNextAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/skipNext', NULL, FALSE, NULL, FALSE), 'onEndAjax' => CRM_Utils_System::url($runner->pathPrefix . '/ajax/onEnd', NULL, FALSE, NULL, FALSE), 'completed' => 0, 'numberOfItems' => $runner->queue->numberOfItems(), 'buttons' => $runner->buttons));
     if ($runner->isMinimal) {
         // Render page header
         if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
             CRM_Utils_System::addHTMLHead($region->render(''));
         }
         $smarty = CRM_Core_Smarty::singleton();
         $content = $smarty->fetch('CRM/Queue/Page/Runner.tpl');
         echo CRM_Utils_System::theme($content, $this->_print, TRUE);
     } else {
         parent::run();
     }
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:25,代码来源:Runner.php

示例4: run

 function run()
 {
     // lets get around the time limit issue if possible for upgrades
     if (!ini_get('safe_mode')) {
         set_time_limit(0);
     }
     $latestVer = CRM_Utils_System::version();
     $currentVer = CRM_Core_BAO_Domain::version();
     if (!$currentVer) {
         CRM_Core_Error::fatal(ts('Version information missing in civicrm database.'));
     } else {
         if (stripos($currentVer, 'upgrade')) {
             CRM_Core_Error::fatal(ts('Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again.'));
         }
     }
     if (!$latestVer) {
         CRM_Core_Error::fatal(ts('Version information missing in civicrm codebase.'));
     }
     // hack to make past ver compatible /w new incremental upgrade process
     $convertVer = array('2.1' => '2.1.0', '2.2' => '2.2.alpha1', '2.2.alph' => '2.2.alpha3', '3.1.0' => '3.1.1');
     if (isset($convertVer[$currentVer])) {
         $currentVer = $convertVer[$currentVer];
     }
     // since version is suppose to be in valid format at this point, especially after conversion ($convertVer),
     // lets do a pattern check -
     if (!CRM_Utils_System::isVersionFormatValid($currentVer)) {
         CRM_Core_Error::fatal(ts('Database is marked with invalid version format. You may want to investigate this before you proceed further.'));
     }
     // This could be removed in later rev
     if ($currentVer == '2.1.6') {
         $config =& CRM_Core_Config::singleton();
         // also cleanup the templates_c directory
         $config->cleanup(1, false);
         if ($config->userFramework !== 'Standalone') {
             // clean the session
             $session =& CRM_Core_Session::singleton();
             $session->reset(2);
         }
     }
     // end of hack
     CRM_Utils_System::setTitle(ts('Upgrade CiviCRM to Version %1', array(1 => $latestVer)));
     $upgrade =& new CRM_Upgrade_Form();
     $template =& CRM_Core_Smarty::singleton();
     $template->assign('pageTitle', ts('Upgrade CiviCRM to Version %1', array(1 => $latestVer)));
     $template->assign('menuRebuildURL', CRM_Utils_System::url('civicrm/menu/rebuild', 'reset=1'));
     $template->assign('cancelURL', CRM_Utils_System::url('civicrm/dashboard', 'reset=1'));
     if (version_compare($currentVer, $latestVer) > 0) {
         // DB version number is higher than codebase being upgraded to. This is unexpected condition-fatal error.
         $dbToolsLink = CRM_Utils_System::docURL2("Database Troubleshooting Tools", true);
         $error = ts('Your database is marked with an unexpected version number: %1. The automated upgrade to version %2 can not be run - and the %2 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. The database tools utility at %3 may be helpful. You may want to revert to the codebase you were using prior to beginning this upgrade until you resolve this problem.', array(1 => $currentVer, 2 => $latestVer, 3 => $dbToolsLink));
         CRM_Core_Error::fatal($error);
     } else {
         if (version_compare($currentVer, $latestVer) == 0) {
             $message = ts('Your database has already been upgraded to CiviCRM %1', array(1 => $latestVer));
             $template->assign('upgraded', true);
         } else {
             $message = ts('CiviCRM upgrade was successful.');
             $template->assign('currentVersion', $currentVer);
             $template->assign('newVersion', $latestVer);
             $template->assign('upgradeTitle', ts('Upgrade CiviCRM from v %1 To v %2', array(1 => $currentVer, 2 => $latestVer)));
             $template->assign('upgraded', false);
             if (CRM_Utils_Array::value('upgrade', $_POST)) {
                 $revisions = $upgrade->getRevisionSequence();
                 foreach ($revisions as $rev) {
                     // proceed only if $currentVer < $rev
                     if (version_compare($currentVer, $rev) < 0) {
                         // as soon as we start doing anything we append ".upgrade" to version.
                         // this also helps detect any partial upgrade issues
                         $upgrade->setVersion($rev . '.upgrade');
                         $phpFunctionName = 'upgrade_' . str_replace('.', '_', $rev);
                         if (is_callable(array($this, $phpFunctionName))) {
                             eval("\$this->{$phpFunctionName}('{$rev}');");
                         } else {
                             $upgrade->processSQL($rev);
                         }
                         // after an successful intermediate upgrade, set the complete version
                         $upgrade->setVersion($rev);
                     }
                 }
                 $upgrade->setVersion($latestVer);
                 $template->assign('upgraded', true);
                 // also cleanup the templates_c directory
                 $config =& CRM_Core_Config::singleton();
                 $config->cleanup(1, false);
                 // clear db caching
                 $config->clearDBCache();
                 // clean the session. Note: In case of standalone this makes the user logout.
                 // So skip this step for standalone.
                 if ($config->userFramework !== 'Standalone') {
                     $session =& CRM_Core_Session::singleton();
                     $session->reset(2);
                 }
             }
         }
     }
     $template->assign('message', $message);
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme('page', $content, true, $this->_print, false, true);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:99,代码来源:Upgrade.php

示例5: run

 /**
  * This function takes care of all the things common to all
  * pages. This typically involves assigning the appropriate
  * smarty variable :)
  *
  * @return string The content generated by running this page
  */
 function run()
 {
     if ($this->_embedded) {
         return;
     }
     $GLOBALS['_CRM_CORE_PAGE']['_template']->assign('mode', $this->_mode);
     $GLOBALS['_CRM_CORE_PAGE']['_template']->assign('tplFile', $this->getTemplateFileName());
     if ($this->_print) {
         $content = $GLOBALS['_CRM_CORE_PAGE']['_template']->fetch('CRM/print.tpl');
     } else {
         $content = $GLOBALS['_CRM_CORE_PAGE']['_template']->fetch('CRM/index.tpl');
     }
     echo CRM_Utils_System::theme('page', $content, null, $this->_print);
     return;
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:22,代码来源:Page.php

示例6: moveFromSessionToTemplate

 /**
  * Move the variables from the session to the template
  *
  * @return void
  * @access public
  */
 function moveFromSessionToTemplate()
 {
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign_by_ref('pager', $this->_pager);
     $rows = $this->_store->get('rows');
     if ($rows) {
         $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('aToZ', $this->_store->get('AToZBar'));
     }
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign_by_ref('sort', $this->_sort);
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('columnHeaders', $this->_store->get('columnHeaders'));
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('rows', $rows);
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('rowsEmpty', $this->_store->get('rowsEmpty'));
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('qill', $this->_store->get('qill'));
     if ($this->_embedded) {
         return;
     }
     $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->assign('tplFile', $this->_object->getTemplateFileName());
     if ($this->_print) {
         $content = $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->fetch('CRM/print.tpl');
     } else {
         $content = $GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template']->fetch('CRM/index.tpl');
     }
     echo CRM_Utils_System::theme('page', $content, null, $this->_print);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:29,代码来源:Controller.php

示例7: renderForm

 /**
  * Render the page using a custom templating system.
  *
  * @param CRM_Core_Form $page
  *   The CRM_Core_Form page.
  */
 public function renderForm(&$page)
 {
     $this->_setRenderTemplates($page);
     $template = CRM_Core_Smarty::singleton();
     $form = $page->toSmarty();
     // Deprecated - use snippet=6 instead of json=1
     $json = CRM_Utils_Request::retrieve('json', 'Boolean', CRM_Core_DAO::$_nullObject);
     if ($json) {
         CRM_Utils_JSON::output($form);
     }
     $template->assign('form', $form);
     $template->assign('isForm', 1);
     $controller =& $page->controller;
     // Stop here if we are in embedded mode. Exception: displaying form errors via ajax
     if ($controller->getEmbedded() && !(!empty($form['errors']) && $controller->_QFResponseType == 'json')) {
         return;
     }
     $template->assign('action', $page->getAction());
     $pageTemplateFile = $page->getHookedTemplateFileName();
     $template->assign('tplFile', $pageTemplateFile);
     $content = $template->fetch($controller->getTemplateFile());
     if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
         CRM_Utils_System::addHTMLHead($region->render(''));
     }
     CRM_Utils_System::appendTPLFile($pageTemplateFile, $content, $page->overrideExtraTemplateFileName());
     //its time to call the hook.
     CRM_Utils_Hook::alterContent($content, 'form', $pageTemplateFile, $page);
     $print = $controller->getPrint();
     if ($print) {
         $html =& $content;
     } else {
         $html = CRM_Utils_System::theme($content, $print);
     }
     if ($controller->_QFResponseType == 'json') {
         $response = array('content' => $html);
         if (!empty($page->ajaxResponse)) {
             $response += $page->ajaxResponse;
         }
         if (!empty($form['errors'])) {
             $response['status'] = 'form_error';
             $response['errors'] = $form['errors'];
         }
         CRM_Core_Page_AJAX::returnJsonResponse($response);
     }
     if ($print) {
         if ($print == CRM_Core_Smarty::PRINT_PDF) {
             CRM_Utils_PDF_Utils::html2pdf($content, "{$page->_name}.pdf", FALSE, array('paper_size' => 'a3', 'orientation' => 'landscape'));
         } else {
             echo $html;
         }
         CRM_Utils_System::civiExit();
     }
     print $html;
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:60,代码来源:Display.php

示例8: runFinish

 /**
  * Display any final messages, clear caches, etc
  */
 public function runFinish()
 {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
     // If we're redirected from queue-runner, then isUpgradePending=true.
     // If user then reloads the finish page, the isUpgradePending will be unset. (Because the session has been cleared.)
     if ($this->get('isUpgradePending')) {
         // TODO: Use structured message store
         $postUpgradeMessage = file_get_contents($this->get('postUpgradeMessageFile'));
         // This destroys $session, so do it after get('postUpgradeMessageFile')
         CRM_Upgrade_Form::doFinish();
     } else {
         $postUpgradeMessage = '';
         // Session was destroyed! Can't recover messages.
     }
     // do a version check - after doFinish() sets the final version
     list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkCurrentVersion($currentVer, $latestVer)) {
         CRM_Core_Error::fatal($error);
     }
     $template->assign('message', $postUpgradeMessage);
     $template->assign('upgraded', TRUE);
     $template->assign('sid', CRM_Utils_System::getSiteID());
     // Render page header
     if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
         CRM_Utils_System::addHTMLHead($region->render(''));
     }
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme($content, $this->_print, TRUE);
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:33,代码来源:Upgrade.php

示例9: outputError

 /**
  * Output code from error function.
  * @param string $content
  */
 public function outputError($content)
 {
     echo CRM_Utils_System::theme($content);
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:8,代码来源:Base.php

示例10: run


//.........这里部分代码省略.........
                                 $customContactSubTypeEdit = $config->customTemplateDir . "CRM/Contact/Form/Edit/" . $subTypeName . ".tpl";
                                 $customContactSubTypeView = $config->customTemplateDir . "CRM/Contact/Page/View/" . $subTypeName . ".tpl";
                                 if (file_exists($customContactSubTypeEdit) || file_exists($customContactSubTypeView)) {
                                     $subTypeTemplates[$subTypeName] = $subTypeName;
                                 }
                             }
                         }
                         foreach ($subTypes as $key => $subTypeName) {
                             $customContactSubTypeEdit = $config->templateDir . "CRM/Contact/Form/Edit/" . $subTypeName . ".tpl";
                             $customContactSubTypeView = $config->templateDir . "CRM/Contact/Page/View/" . $subTypeName . ".tpl";
                             if (file_exists($customContactSubTypeEdit) || file_exists($customContactSubTypeView)) {
                                 $subTypeTemplates[$subTypeName] = $subTypeName;
                             }
                         }
                         if (!empty($subTypeTemplates)) {
                             $subTypeTemplates = implode(',', $subTypeTemplates);
                             $message .= '<br />' . ts('You are using custom template for contact subtypes: %1.', array(1 => $subTypeTemplates)) . '<br />' . ts('You need to move these subtype templates to the SubType directory in %1 and %2 respectively.', array(1 => 'CRM/Contact/Form/Edit', 2 => 'CRM/Contact/Page/View'));
                         }
                     }
                 } else {
                     if ($latestVer == '3.2.beta4') {
                         $statuses = array('New', 'Current', 'Grace', 'Expired', 'Pending', 'Cancelled', 'Deceased');
                         $sql = "\nSELECT  count( id ) as statusCount \n  FROM  civicrm_membership_status \n WHERE  name IN ( '" . implode("' , '", $statuses) . "' ) ";
                         $count = CRM_Core_DAO::singleValueQuery($sql);
                         if ($count < count($statuses)) {
                             $message .= '<br />' . ts("One or more Membership Status Rules was disabled during the upgrade because it did not match a recognized status name. if custom membership status rules were added to this site - review the disabled statuses and re-enable any that are still needed (Administer > CiviMember > Membership Status Rules).");
                         }
                     }
                 }
             }
             $template->assign('currentVersion', $currentVer);
             $template->assign('newVersion', $latestVer);
             $template->assign('upgradeTitle', ts('Upgrade CiviCRM from v %1 To v %2', array(1 => $currentVer, 2 => $latestVer)));
             $template->assign('upgraded', false);
             if (CRM_Utils_Array::value('upgrade', $_POST)) {
                 $revisions = $upgrade->getRevisionSequence();
                 foreach ($revisions as $rev) {
                     // proceed only if $currentVer < $rev
                     if (version_compare($currentVer, $rev) < 0) {
                         // as soon as we start doing anything we append ".upgrade" to version.
                         // this also helps detect any partial upgrade issues
                         $upgrade->setVersion($rev . '.upgrade');
                         $phpFunctionName = 'upgrade_' . str_replace('.', '_', $rev);
                         // follow old upgrade process for all version
                         // below 3.2.alpha1
                         if (version_compare($rev, '3.2.alpha1') < 0) {
                             if (is_callable(array($this, $phpFunctionName))) {
                                 eval("\$this->{$phpFunctionName}('{$rev}');");
                             } else {
                                 $upgrade->processSQL($rev);
                             }
                         } else {
                             // new upgrade process from version
                             // 3.2.alpha1
                             $versionObject = $upgrade->incrementalPhpObject($rev);
                             // predb check for major release.
                             if ($upgrade->checkVersionRelease($rev, 'alpha1')) {
                                 if (!is_callable(array($versionObject, 'verifyPreDBstate'))) {
                                     CRM_Core_Error::fatal("verifyPreDBstate method was not found for {$rev}");
                                 }
                                 $error = null;
                                 if (!$versionObject->verifyPreDBstate($error)) {
                                     if (!isset($error)) {
                                         $error = "post-condition failed for current upgrade for {$rev}";
                                     }
                                     CRM_Core_Error::fatal($error);
                                 }
                             }
                             if (is_callable(array($versionObject, $phpFunctionName))) {
                                 $versionObject->{$phpFunctionName}($rev);
                             } else {
                                 $upgrade->processSQL($rev);
                             }
                         }
                         // after an successful intermediate upgrade, set the complete version
                         $upgrade->setVersion($rev);
                     }
                 }
                 $upgrade->setVersion($latestVer);
                 $template->assign('upgraded', true);
                 // also cleanup the templates_c directory
                 $config = CRM_Core_Config::singleton();
                 $config->cleanup(1, false);
                 // clear db caching
                 $config->clearDBCache();
                 // clear temporary tables
                 $config->clearTempTables();
                 // clean the session. Note: In case of standalone this makes the user logout.
                 // So skip this step for standalone.
                 if ($config->userFramework !== 'Standalone') {
                     $session = CRM_Core_Session::singleton();
                     $session->reset(2);
                 }
             }
         }
     }
     $template->assign('message', $message);
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme('page', $content, true, $this->_print, false, true);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:101,代码来源:Upgrade.php

示例11: fatal

 /**
  * display an error page with an error message describing what happened
  *
  * @param string message  the error message
  * @param string code     the error code if any
  * @param string email    the email address to notify of this situation
  *
  * @return void
  * @static
  * @acess public
  */
 static function fatal($message = null, $code = null, $email = null)
 {
     if (!$message) {
         $message = ts('We experienced an unexpected error. Please post a detailed description and the backtrace on the CiviCRM forums: %1', array(1 => 'http://forum.civicrm.org/'));
     }
     $vars = array('message' => $message, 'code' => $code);
     $config =& CRM_Core_Config::singleton();
     if ($config->fatalErrorHandler && function_exists($config->fatalErrorHandler)) {
         $name = $config->fatalErrorHandler;
         $ret = $name($vars);
         if ($ret) {
             // the call has been successfully handled
             // so we just exit
             exit(CRM_Core_Error::FATAL_ERROR);
         }
     }
     if ($config->backtrace) {
         self::backtrace();
     }
     $template =& CRM_Core_Smarty::singleton();
     $template->assign($vars);
     CRM_Core_Error::debug_var('Fatal Error Details', $vars);
     CRM_Core_Error::backtrace('backTrace', true);
     $content = $template->fetch($config->fatalErrorTemplate);
     echo CRM_Utils_System::theme('page', $content);
     // print $content;
     exit(CRM_Core_Error::FATAL_ERROR);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:39,代码来源:Error.php

示例12: runFinish

 /**
  * Display any final messages, clear caches, etc
  */
 function runFinish()
 {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
     // TODO: Use structured message store
     $postUpgradeMessage = file_get_contents($this->get('postUpgradeMessageFile'));
     // This destroys $session, so do it after ge('postUpgradeMessageFile')
     CRM_Upgrade_Form::doFinish();
     // do a version check - after doFinish() sets the final version
     list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkCurrentVersion($currentVer, $latestVer)) {
         CRM_Core_Error::fatal($error);
     }
     $template->assign('message', $postUpgradeMessage);
     $template->assign('upgraded', TRUE);
     $content = $template->fetch('CRM/common/success.tpl');
     echo CRM_Utils_System::theme('page', $content, TRUE, $this->_print, FALSE, TRUE);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:21,代码来源:Upgrade.php

示例13: handle

 /**
  * create the main callback method. this method centralizes error processing.
  *
  * the errors we expect are from the pear modules DB, DB_DataObject
  * which currently use PEAR::raiseError to notify of error messages.
  *
  * @param object PEAR_Error
  *
  * @return void
  * @access public
  */
 function handle($pearError)
 {
     // setup smarty with config, session and template location.
     $template =& CRM_Core_Smarty::singleton();
     $config =& CRM_Core_Config::singleton();
     if ($config->debug && ($_REQUEST['backtrace'] || defined('CIVICRM_BACKTRACE'))) {
         CRM_Core_Error::backtrace();
     }
     // create the error array
     $error = array();
     $error['callback'] = $pearError->getCallback();
     $error['code'] = $pearError->getCode();
     $error['message'] = $pearError->getMessage();
     $error['mode'] = $pearError->getMode();
     $error['debug_info'] = $pearError->getDebugInfo();
     $error['type'] = $pearError->getType();
     $error['user_info'] = $pearError->getUserInfo();
     $error['to_string'] = $pearError->toString();
     if (mysql_error()) {
         $mysql_error = mysql_error() . ', ' . mysql_errno();
         $template->assign_by_ref('mysql_code', $mysql_error);
         // execute a dummy query to clear error stack
         mysql_query('select 1');
     }
     $template->assign_by_ref('error', $error);
     $template->assign('tplFile', "CRM/" . CRM_CORE_ERROR_ERROR_TEMPLATE);
     $content = $template->fetch('CRM/error.tpl');
     $content .= CRM_Core_Error::debug('error', $error, false);
     echo CRM_Utils_System::theme('page', $content);
     exit(1);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:42,代码来源:Error.php

示例14: run

 /**
  * This function takes care of all the things common to all
  * pages. This typically involves assigning the appropriate
  * smarty variable :)
  *
  * @return string The content generated by running this page
  */
 function run()
 {
     if ($this->_embedded) {
         return;
     }
     self::$_template->assign('mode', $this->_mode);
     $pageTemplateFile = $this->getTemplateFileName();
     self::$_template->assign('tplFile', $pageTemplateFile);
     // invoke the pagRun hook, CRM-3906
     CRM_Utils_Hook::pageRun($this);
     if ($this->_print) {
         if (in_array($this->_print, array(CRM_Core_Smarty::PRINT_SNIPPET, CRM_Core_Smarty::PRINT_PDF, CRM_Core_Smarty::PRINT_NOFORM))) {
             $content = self::$_template->fetch('CRM/common/snippet.tpl');
         } else {
             $content = self::$_template->fetch('CRM/common/print.tpl');
         }
         CRM_Utils_System::appendTPLFile($pageTemplateFile, $content, $this->overrideExtraTemplateFileName());
         //its time to call the hook.
         CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this);
         if ($this->_print == CRM_Core_Smarty::PRINT_PDF) {
             CRM_Utils_PDF_Utils::html2pdf($content, "{$this->_name}.pdf", FALSE, array('paper_size' => 'a3', 'orientation' => 'landscape'));
         } else {
             echo $content;
         }
         CRM_Utils_System::civiExit();
     }
     $config = CRM_Core_Config::singleton();
     $content = self::$_template->fetch('CRM/common/' . strtolower($config->userFramework) . '.tpl');
     if ($region = CRM_Core_Region::instance('html-header', FALSE)) {
         CRM_Utils_System::addHTMLHead($region->render(''));
     }
     CRM_Utils_System::appendTPLFile($pageTemplateFile, $content);
     //its time to call the hook.
     CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this);
     echo CRM_Utils_System::theme('page', $content, TRUE, $this->_print);
     return;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:44,代码来源:Page.php

示例15: moveFromSessionToTemplate

 /**
  * Move the variables from the session to the template
  *
  * @return void
  * @access public
  */
 function moveFromSessionToTemplate()
 {
     self::$_template->assign_by_ref("{$this->_prefix}pager", $this->_pager);
     $rows = $this->_store->get("{$this->_prefix}rows");
     if ($rows) {
         if ($this->_dynamicAction) {
             $this->_object->addActions($rows);
         }
         self::$_template->assign("{$this->_prefix}aToZ", $this->_store->get("{$this->_prefix}AToZBar"));
     }
     self::$_template->assign_by_ref("{$this->_prefix}sort", $this->_sort);
     self::$_template->assign("{$this->_prefix}columnHeaders", $this->_store->get("{$this->_prefix}columnHeaders"));
     self::$_template->assign("{$this->_prefix}rows", $rows);
     self::$_template->assign("{$this->_prefix}rowsEmpty", $this->_store->get("{$this->_prefix}rowsEmpty"));
     self::$_template->assign("{$this->_prefix}qill", $this->_store->get("{$this->_prefix}qill"));
     self::$_template->assign("{$this->_prefix}summary", $this->_store->get("{$this->_prefix}summary"));
     if ($this->_embedded) {
         return;
     }
     self::$_template->assign('tplFile', $this->_object->getTemplateFileName());
     if ($this->_print) {
         $content = self::$_template->fetch('CRM/common/print.tpl');
     } else {
         $config = CRM_Core_Config::singleton();
         $content = self::$_template->fetch('CRM/common/' . strtolower($config->userFramework) . '.tpl');
     }
     echo CRM_Utils_System::theme('page', $content, TRUE, $this->_print);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:34,代码来源:Controller.php


注:本文中的CRM_Utils_System::theme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。