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


PHP CRM_Core_Region::instance方法代码示例

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


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

示例1: run

 function run()
 {
     // Add our template
     CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
     CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
     parent::run();
 }
开发者ID:adam-edison,项目名称:org.civicrm.volunteer,代码行数:7,代码来源:Backbone.php

示例2: theme

 /**
  * if we are using a theming system, invoke theme, else just print the
  * content
  *
  * @param string  $content the content that will be themed
  * @param boolean $print   are we displaying to the screen or bypassing theming?
  * @param boolean $maintenance  for maintenance mode
  *
  * @return void           prints content on stdout
  * @access public
  */
 function theme(&$content, $print = FALSE, $maintenance = FALSE)
 {
     $ret = FALSE;
     // TODO: Split up; this was copied verbatim from CiviCRM 4.0's multi-UF theming function
     // but the parts should be copied into cleaner subclass implementations
     $config = CRM_Core_Config::singleton();
     if ($config->userSystem->is_drupal && function_exists('theme') && !$print) {
         if ($maintenance) {
             drupal_set_breadcrumb('');
             drupal_maintenance_theme();
             if ($region = CRM_Core_Region::instance('html-header', FALSE)) {
                 CRM_Utils_System::addHTMLHead($region->render(''));
             }
             print theme('maintenance_page', array('content' => $content));
             exit;
         }
         $ret = TRUE;
         // TODO: Figure out why D7 returns but everyone else prints
     }
     $out = $content;
     $config =& CRM_Core_Config::singleton();
     if (!$print && $config->userFramework == 'WordPress') {
         if (is_admin()) {
             require_once ABSPATH . 'wp-admin/admin-header.php';
         } else {
             // FIX ME: we need to figure out to replace civicrm content on the frontend pages
         }
     }
     if ($ret) {
         return $out;
     } else {
         print $out;
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:45,代码来源:Base.php

示例3: buildForm

 function buildForm(&$form)
 {
     // check if we're in test mode
     if ($this->_mode == 'test') {
         $test = ' Test';
     } else {
         $test = '';
     }
     // we don't need the default stuff:
     $form->_paymentFields = array();
     $form->add('text', 'bank_account_number', ts('IBAN'), array('size' => 34, 'maxlength' => 34), TRUE);
     $form->add('text', 'bank_identification_number', ts('BIC'), array('size' => 11, 'maxlength' => 11), TRUE);
     $form->add('text', 'bank_name', ts('Bank Name'), array('size' => 20, 'maxlength' => 64), FALSE);
     $form->add('text', 'account_holder', ts('Account Holder'), array('size' => 20, 'maxlength' => 64), FALSE);
     $form->add('select', 'cycle_day', ts('Collection Day'), CRM_Sepa_Logic_Settings::getListSetting("cycledays", range(1, 28), $this->_creditorId), FALSE);
     $form->addDate('start_date', ts('start date'), TRUE, array());
     $form->registerRule('sepa_iban_valid', 'callback', 'rule_valid_IBAN', 'CRM_Sepa_Logic_Verification');
     $form->registerRule('sepa_bic_valid', 'callback', 'rule_valid_BIC', 'CRM_Sepa_Logic_Verification');
     $form->addRule('bank_account_number', ts('This is not a correct IBAN.'), 'sepa_iban_valid');
     $form->addRule('bank_identification_number', ts('This is not a correct BIC.'), 'sepa_bic_valid');
     $rcur_notice_days = (int) CRM_Sepa_Logic_Settings::getSetting("batching.RCUR.notice", $this->_creditorId);
     $ooff_notice_days = (int) CRM_Sepa_Logic_Settings::getSetting("batching.OOFF.notice", $this->_creditorId);
     $timestamp_rcur = strtotime("now + {$rcur_notice_days} days");
     $timestamp_ooff = strtotime("now + {$ooff_notice_days} days");
     $earliest_rcur_date = array(date('Y', $timestamp_rcur), date('m', $timestamp_rcur), date('d', $timestamp_rcur));
     $earliest_ooff_date = array(date('Y', $timestamp_ooff), date('m', $timestamp_ooff), date('d', $timestamp_ooff));
     $form->assign('earliest_rcur_date', $earliest_rcur_date);
     $form->assign('earliest_ooff_date', $earliest_ooff_date);
     CRM_Core_Region::instance('billing-block')->add(array('template' => 'CRM/Core/Payment/SEPA/SDD.tpl', 'weight' => -1));
 }
开发者ID:scardinius,项目名称:org.project60.sepa,代码行数:30,代码来源:SDD.php

示例4: addResources

 /**
  * Load needed JS, CSS and settings for the backend Volunteer Management UI
  */
 public static function addResources($entity_id, $entity_table)
 {
     static $loaded = FALSE;
     $ccr = CRM_Core_Resources::singleton();
     if ($loaded || $ccr->isAjaxMode()) {
         return;
     }
     $loaded = TRUE;
     $config = CRM_Core_Config::singleton();
     // Vendor libraries
     $ccr->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE);
     $ccr->addScriptFile('civicrm', 'packages/backbone/backbone-min.js', 120, 'html-header', FALSE);
     $ccr->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.min.js', 125, 'html-header', FALSE);
     // Our stylesheet
     $ccr->addStyleFile('org.civicrm.volunteer', 'css/volunteer_app.css');
     // Add all scripts for our js app
     $weight = 0;
     $baseDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.volunteer') . '/';
     // This glob pattern will recurse the js directory up to 4 levels deep
     foreach (glob($baseDir . 'js/backbone/{*,*/*,*/*/*,*/*/*/*}.js', GLOB_BRACE) as $file) {
         $fileName = substr($file, strlen($baseDir));
         $ccr->addScriptFile('org.civicrm.volunteer', $fileName, $weight++);
     }
     // Add our template
     CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
     CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
     // Fetch event so we can set the default start time for needs
     // FIXME: Not the greatest for supporting non-events
     $entity = civicrm_api3(str_replace('civicrm_', '', $entity_table), 'getsingle', array('id' => $entity_id));
     // Static variables
     $ccr->addSetting(array('pseudoConstant' => array('volunteer_need_visibility' => array_flip(CRM_Volunteer_BAO_Need::buildOptions('visibility_id', 'validate')), 'volunteer_role' => CRM_Volunteer_BAO_Need::buildOptions('role_id', 'get'), 'volunteer_status' => CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate')), 'volunteer' => array('default_date' => CRM_Utils_Array::value('start_date', $entity)), 'config' => array('timeInputFormat' => $config->timeInputFormat), 'constants' => array('CRM_Core_Action' => array('NONE' => 0, 'ADD' => 1, 'UPDATE' => 2, 'VIEW' => 4, 'DELETE' => 8, 'BROWSE' => 16, 'ENABLE' => 32, 'DISABLE' => 64, 'EXPORT' => 128, 'BASIC' => 256, 'ADVANCED' => 512, 'PREVIEW' => 1024, 'FOLLOWUP' => 2048, 'MAP' => 4096, 'PROFILE' => 8192, 'COPY' => 16384, 'RENEW' => 32768, 'DETACH' => 65536, 'REVERT' => 131072, 'CLOSE' => 262144, 'REOPEN' => 524288, 'MAX_ACTION' => 1048575))));
     // Check for problems
     _volunteer_checkResourceUrl();
 }
开发者ID:TobiasLounsbury,项目名称:org.civicrm.volunteer,代码行数:37,代码来源:Manage.php

示例5: buildForm

 function buildForm(&$form)
 {
     // Change the label on the "name" fields, and make mandatory
     // (they are mandatory for CC transactions, but not shown as such in the form by default
     // because of the 'pay later' option)
     $fields = array('billing_first_name' => ts('First Name'), 'billing_last_name' => ts('Last Name'), 'billing_individual_prefix' => ts('Title'));
     foreach ($fields as $field => $title) {
         if ($form->elementExists($field)) {
             $e =& $form->getElement($field);
             $e->setLabel($title);
             $form->addRule($field, ts('%1 is a required field.', array(1 => $title)), 'required');
         }
     }
     $fields = array('billing_street_address-5', 'billing_city-5', 'billing_country_id-5', 'billing_state_province_id-5', 'billing_postal_code-5');
     foreach ($fields as $field) {
         if ($form->elementExists($field)) {
             $e =& $form->getElement($field);
             $title = $e->getLabel();
             $form->addRule($field, ts('%1 is a required field.', array(1 => $title)), 'required');
         }
     }
     CRM_Core_Region::instance('page-body')->add(array('template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.validate.tpl'));
     // Preview & demo sites should encourage to use a test CC number
     // otherwise users do not know what CC to use, and sometimes use their own.
     if (CRM_Utils_Array::value('action', $_REQUEST) == 'preview' || !empty($GLOBALS['symbioticux_demo']) || CRM_Utils_Array::value('name', $form->_paymentProcessors[1]) == 'Dummy') {
         CRM_Core_Region::instance('page-body')->add(array('template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.billing-explain.tpl'));
         $js = "cj('#credit_card_number').click(function(event) {\n               if (! cj(this).val()) {\n                 cj(this).val('4111111111111111').trigger('change');\n                 cj('#cvv2').val('123').trigger('change');\n                 cj('#credit_card_exp_date_m').val('5').trigger('change');\n                 cj('#credit_card_exp_date_Y').val('2018').trigger('change');\n\n                 cj('.symbioticux-billing-explain-cc').prependTo('.credit_card_info-section').slideDown();\n               }\n             });";
         CRM_Core_Resources::singleton()->addScript($js);
     }
     CRM_Core_Region::instance('page-body')->add(array('template' => 'CRM/Symbioticux/Contribute/Form/Contribution/Main.hide-other-amount.tpl'));
     // Remove some CSS classes on the 'submit' button.
     $js = "cj('.crm-submit-buttons .crm-form-submit').addClass('btn btn-primary').removeClass('crm-form-submit').parent().removeClass('crm-button');";
     CRM_Core_Resources::singleton()->addScript($js);
 }
开发者ID:coopsymbiotic,项目名称:coop.symbiotic.symbioticux,代码行数:34,代码来源:Main.php

示例6: mailjet_civicrm_pageRun

/**
 * Implementation of hook_civicrm_pageRun
 *
 * Handler for pageRun hook.
 */
function mailjet_civicrm_pageRun(&$page)
{
    if (get_class($page) == 'CRM_Mailing_Page_Report') {
        $mailingId = $page->_mailing_id;
        $mailingJobs = civicrm_api3('MailingJob', 'get', $params = array('mailing_id' => $mailingId));
        $stats = array('BlockedCount' => 0, 'BouncedCount' => 0, 'ClickedCount' => 0, 'DeliveredCount' => 0, 'OpenedCount' => 0, 'ProcessedCount' => 0, 'QueuedCount' => 0, 'SpamComplaintCount' => 0, 'UnsubscribedCount' => 0);
        foreach ($mailingJobs['values'] as $key => $job) {
            if ($job['job_type'] == 'child') {
                $jobId = $key;
                require_once 'packages/mailjet-0.3/php-mailjet-v3-simple.class.php';
                // Create a new Mailjet Object
                $mj = new Mailjet(MAILJET_API_KEY, MAILJET_SECRET_KEY);
                $mj->debug = 0;
                $mailJetParams = array('method' => 'VIEW', 'unique' => CRM_Mailjet_BAO_Event::getMailjetCustomCampaignId($jobId));
                $response = $mj->campaign($mailJetParams);
                $page->assign('mailjet_params', $mailJetParams);
                if (!empty($response)) {
                    if ($response->Count == 1) {
                        $campaign = $response->Data[0];
                        $mailJetParams = array('method' => 'VIEW', 'unique' => $campaign->ID);
                        $response = $mj->campaignstatistics($mailJetParams);
                        if ($response->Count == 1) {
                            $stats = sumUpStats($stats, get_object_vars($response->Data[0]));
                        }
                    }
                }
            }
        }
        $page->assign('mailjet_stats', $stats);
        CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Mailjet/Page/Report.tpl'));
    }
}
开发者ID:WeMoveEU,项目名称:uk.co.compucorp.civicrm.mailjet,代码行数:37,代码来源:mailjet.php

示例7: addResources

 /**
  * Load needed JS, CSS and settings for the backend Volunteer Management UI
  */
 public static function addResources($entity_id, $entity_table)
 {
     static $loaded = FALSE;
     if ($loaded) {
         return;
     }
     $loaded = TRUE;
     $config = CRM_Core_Config::singleton();
     $ccr = CRM_Core_Resources::singleton();
     // Vendor libraries
     $ccr->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE);
     $ccr->addScriptFile('civicrm', 'packages/backbone/backbone-min.js', 120, 'html-header');
     $ccr->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.min.js', 125, 'html-header', FALSE);
     // Our stylesheet
     $ccr->addStyleFile('org.civicrm.volunteer', 'css/volunteer_app.css');
     // Add all scripts for our js app
     $weight = 0;
     $baseDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.volunteer') . '/';
     // This glob pattern will recurse the js directory up to 4 levels deep
     foreach (glob($baseDir . 'js/{*,*/*,*/*/*,*/*/*/*}.js', GLOB_BRACE) as $file) {
         $fileName = substr($file, strlen($baseDir));
         $ccr->addScriptFile('org.civicrm.volunteer', $fileName, $weight++);
     }
     // Add our template
     CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
     CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
     // Fetch event so we can set the default start time for needs
     // FIXME: Not the greatest for supporting non-events
     $entity = civicrm_api3(str_replace('civicrm_', '', $entity_table), 'getsingle', array('id' => $entity_id));
     // Static variables
     $ccr->addSetting(array('pseudoConstant' => array('volunteer_need_visibility' => array_flip(CRM_Volunteer_BAO_Need::buildOptions('visibility_id', 'validate')), 'volunteer_role' => CRM_Volunteer_BAO_Need::buildOptions('role_id', 'get'), 'volunteer_status' => CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate')), 'volunteer' => array('default_date' => CRM_Utils_Array::value('start_date', $entity)), 'config' => array('timeInputFormat' => $config->timeInputFormat)));
     // Check for problems
     _volunteer_civicrm_check_resource_url();
 }
开发者ID:relldoesphp,项目名称:civivolunteer,代码行数:37,代码来源:Manage.php

示例8: buildForm

 public function buildForm($formName, &$form)
 {
     if ($formName != 'CRM_Contribute_Form_Contribution') {
         return;
     }
     if (!CRM_Core_Permission::check('edit memberships')) {
         return;
     }
     $contact_id = $form->getVar('_contactID');
     if (!$contact_id) {
         return;
     }
     $current_membership_id = false;
     $contribution_id = $form->getVar('_id');
     if ($contribution_id) {
         $current_membership_id = CRM_Core_DAO::singleValueQuery("SELECT membership_id FROM civicrm_membership_payment where contribution_id = %1", array(1 => array($contribution_id, 'Integer')));
     }
     $memberships = array('' => ts('-- None --')) + $this->getMembershipsForContact($contact_id);
     $snippet['template'] = 'CRM/Membershippayment/Contribution/Form.tpl';
     $snippet['contact_id'] = $contact_id;
     $form->add('select', 'membership_id', ts('Membership'), $memberships);
     if ($current_membership_id) {
         $defaults['membership_id'] = $current_membership_id;
         $form->setDefaults($defaults);
     }
     CRM_Core_Region::instance('page-body')->add($snippet);
 }
开发者ID:dragonjon,项目名称:org.civicoop.membershippayment,代码行数:27,代码来源:Form.php

示例9: buildForm

 /**
  * Method to process civicrm buildForm hook
  *
  * User can only manage group settings for non-protected groups or if user has permissions
  */
 public static function buildForm($formName, $form)
 {
     if ($formName == 'CRM_Group_Form_Edit') {
         $protectGroupAllowed = CRM_Core_Permission::check('manage protected groups');
         if (!$protectGroupAllowed) {
             CRM_Core_Region::instance('page-body')->add(array('template' => 'GroupProtect.tpl'));
         }
     }
 }
开发者ID:CiviCooP,项目名称:org.civicoop.groupprotect,代码行数:14,代码来源:GroupProtect.php

示例10: html2pdf

 /**
  * @param $text
  * @param string $fileName
  * @param bool $output
  * @param null $pdfFormat
  *
  * @return string|void
  */
 public static function html2pdf(&$text, $fileName = 'civicrm.pdf', $output = FALSE, $pdfFormat = NULL)
 {
     if (is_array($text)) {
         $pages =& $text;
     } else {
         $pages = array($text);
     }
     // Get PDF Page Format
     $format = CRM_Core_BAO_PdfFormat::getDefaultValues();
     if (is_array($pdfFormat)) {
         // PDF Page Format parameters passed in
         $format = array_merge($format, $pdfFormat);
     } else {
         // PDF Page Format ID passed in
         $format = CRM_Core_BAO_PdfFormat::getById($pdfFormat);
     }
     $paperSize = CRM_Core_BAO_PaperSize::getByName($format['paper_size']);
     $paper_width = self::convertMetric($paperSize['width'], $paperSize['metric'], 'pt');
     $paper_height = self::convertMetric($paperSize['height'], $paperSize['metric'], 'pt');
     // dompdf requires dimensions in points
     $paper_size = array(0, 0, $paper_width, $paper_height);
     $orientation = CRM_Core_BAO_PdfFormat::getValue('orientation', $format);
     $metric = CRM_Core_BAO_PdfFormat::getValue('metric', $format);
     $t = CRM_Core_BAO_PdfFormat::getValue('margin_top', $format);
     $r = CRM_Core_BAO_PdfFormat::getValue('margin_right', $format);
     $b = CRM_Core_BAO_PdfFormat::getValue('margin_bottom', $format);
     $l = CRM_Core_BAO_PdfFormat::getValue('margin_left', $format);
     $stationery_path_partial = CRM_Core_BAO_PdfFormat::getValue('stationery', $format);
     $stationery_path = NULL;
     if (strlen($stationery_path_partial)) {
         $doc_root = $_SERVER['DOCUMENT_ROOT'];
         $stationery_path = $doc_root . "/" . $stationery_path_partial;
     }
     $margins = array($metric, $t, $r, $b, $l);
     $config = CRM_Core_Config::singleton();
     // Add a special region for the HTML header of PDF files:
     $pdfHeaderRegion = CRM_Core_Region::instance('export-document-header', FALSE);
     $htmlHeader = $pdfHeaderRegion ? $pdfHeaderRegion->render('', FALSE) : '';
     $html = "\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n    <style>@page { margin: {$t}{$metric} {$r}{$metric} {$b}{$metric} {$l}{$metric}; }</style>\n    <style type=\"text/css\">@import url({$config->userFrameworkResourceURL}css/print.css);</style>\n    {$htmlHeader}\n  </head>\n  <body>\n    <div id=\"crm-container\">\n";
     // Strip <html>, <header>, and <body> tags from each page
     $htmlElementstoStrip = array('@<head[^>]*?>.*?</head>@siu', '@<script[^>]*?>.*?</script>@siu', '@<body>@siu', '@</body>@siu', '@<html[^>]*?>@siu', '@</html>@siu', '@<!DOCTYPE[^>]*?>@siu');
     $htmlElementsInstead = array('', '', '', '', '', '');
     foreach ($pages as &$page) {
         $page = preg_replace($htmlElementstoStrip, $htmlElementsInstead, $page);
     }
     // Glue the pages together
     $html .= implode("\n<div style=\"page-break-after: always\"></div>\n", $pages);
     $html .= "\n    </div>\n  </body>\n</html>";
     if ($config->wkhtmltopdfPath) {
         return self::_html2pdf_wkhtmltopdf($paper_size, $orientation, $margins, $html, $output, $fileName);
     } else {
         return self::_html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName);
         //return self::_html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName,  $stationery_path);
     }
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:63,代码来源:Utils.php

示例11: registerProfileScripts

 public static function registerProfileScripts()
 {
     static $loaded = FALSE;
     if ($loaded || CRM_Core_Resources::isAjaxMode()) {
         return;
     }
     $loaded = TRUE;
     CRM_Core_Resources::singleton()->addSettingsFactory(function () {
         return array('PseudoConstant' => array('locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), 'websiteType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'), 'phoneType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id')), 'initialProfileList' => civicrm_api('UFGroup', 'get', array('version' => 3, 'sequential' => 1, 'is_active' => 1, 'rowCount' => 1000)), 'contactSubTypes' => CRM_Contact_BAO_ContactType::subTypes(), 'profilePreviewKey' => CRM_Core_Key::get('CRM_UF_Form_Inline_Preview', TRUE));
     })->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone/backbone.js', 120, 'html-header')->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.js', 125, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone/backbone.collectionsubset.js', 125, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone-forms/distribution/backbone-forms.js', 130, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone-forms/distribution/adapters/backbone.bootstrap-modal.min.js', 140, 'html-header', FALSE)->addScriptFile('civicrm', 'packages/backbone-forms/distribution/editors/list.min.js', 140, 'html-header', FALSE)->addStyleFile('civicrm', 'packages/backbone-forms/distribution/templates/default.css', 140, 'html-header')->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header')->addStyleFile('civicrm', 'css/crm.designer.css', 140, 'html-header')->addScriptFile('civicrm', 'js/crm.backbone.js', 150)->addScriptFile('civicrm', 'js/model/crm.schema-mapped.js', 200)->addScriptFile('civicrm', 'js/model/crm.uf.js', 200)->addScriptFile('civicrm', 'js/model/crm.designer.js', 200)->addScriptFile('civicrm', 'js/model/crm.profile-selector.js', 200)->addScriptFile('civicrm', 'js/view/crm.designer.js', 200)->addScriptFile('civicrm', 'js/view/crm.profile-selector.js', 200)->addScriptFile('civicrm', 'js/jquery/jquery.crmProfileSelector.js', 250)->addScriptFile('civicrm', 'js/crm.designerapp.js', 250);
     CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/UF/Page/ProfileTemplates.tpl'));
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:12,代码来源:ProfileEditor.php

示例12: _volunteer_civicrm_buildForm_CRM_Custom_Form_Field

/**
 * Delegated implementation of hook_civicrm_buildForm
 *
 * Customizes the UI for adding custom fields to allow the user to specify whether
 * a multi-select field should use the slider widget or not
 */
function _volunteer_civicrm_buildForm_CRM_Custom_Form_Field($formName, CRM_Core_Form &$form)
{
    // set default value for the checkbox
    $field_id = $form->getVar('_id');
    $widgetized_fields = _volunteer_get_slider_fields();
    $form->_defaultValues['is_slider_widget'] = in_array($field_id, $widgetized_fields);
    // add checkbox to the form object
    $form->add('checkbox', 'is_slider_widget', ts('Use Slider Selector?'));
    // add checkbox to the display
    CRM_Core_Region::instance('page-body')->add(array('template' => 'Slider/CRM/Custom/Form/Field.tpl'));
    // reposition and show/hide checkbox
    CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.volunteer', 'js/CRM_Custom_Form_Field.js');
}
开发者ID:adam-edison,项目名称:org.civicrm.volunteer,代码行数:19,代码来源:volunteer.slider.php

示例13: hrvisa_civicrm_buildProfile

/**
 * Implementation of hook_civicrm_buildProfile
 */
function hrvisa_civicrm_buildProfile($name)
{
    if ($name == 'hrvisa_tab') {
        // To fix validation alert issue
        $smarty = CRM_Core_Smarty::singleton();
        $smarty->assign('urlIsPublic', FALSE);
        $contactID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
        $config = CRM_Core_Config::singleton();
        if ($config->logging && 'multiProfileDialog' !== CRM_Utils_Request::retrieve('context', 'String', CRM_Core_DAO::$_nullObject)) {
            CRM_Core_Region::instance('profile-form-hrvisa_tab')->add(array('template' => 'CRM/common/logButton.tpl', 'instance_id' => CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'), 'css_class' => 'hrvisa-revision-link', 'table_name' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', 'Immigration', 'table_name', 'name'), 'contact_id' => $contactID, 'weight' => -2));
        }
    }
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:16,代码来源:hrvisa.php

示例14: smarty_block_crmRegion

/**
 * Smarty block function for defining content-regions which can be dynamically-altered
 *
 * @see CRM_Core_Regions
 *
 * @param array $params   must define 'name'
 * @param string $content    Default content
 * @param object $smarty  the Smarty object
 *
 * @return string
 */
function smarty_block_crmRegion($params, $content, &$smarty, &$repeat)
{
    if ($repeat) {
        return;
    }
    require_once 'CRM/Core/Region.php';
    $region = CRM_Core_Region::instance($params['name'], FALSE);
    if ($region) {
        $result = $region->render($content);
        return $result;
    } else {
        return $content;
    }
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:25,代码来源:block.crmRegion.php

示例15: smarty_block_crmRegion

/**
 * Smarty block function for defining content-regions which can be dynamically-altered
 *
 * @see CRM_Core_Regions
 *
 * @param array $params
 *   Must define 'name'.
 * @param string $content
 *   Default content.
 * @param CRM_Core_Smarty $smarty
 *   The Smarty object.
 *
 * @param $repeat
 *
 * @return string
 */
function smarty_block_crmRegion($params, $content, &$smarty, &$repeat)
{
    if ($repeat) {
        return NULL;
    }
    require_once 'CRM/Core/Region.php';
    $region = CRM_Core_Region::instance($params['name'], FALSE);
    if ($region) {
        $result = $region->render($content, CRM_Utils_Array::value('allowCmsOverride', $params, TRUE));
        return $result;
    } else {
        return $content;
    }
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:30,代码来源:block.crmRegion.php


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