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


PHP CRM_Utils_System::url方法代码示例

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


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

示例1: getRunner

 static function getRunner($skipEndUrl = FALSE)
 {
     // Setup the Queue
     $queue = CRM_Queue_Service::singleton()->create(array('name' => self::QUEUE_NAME, 'type' => 'Sql', 'reset' => TRUE));
     // reset pull stats.
     CRM_Core_BAO_Setting::setItem(array(), CRM_Mailchimp_Form_Setting::MC_SETTING_GROUP, 'pull_stats');
     $stats = array();
     // We need to process one list at a time.
     $groups = CRM_Mailchimp_Utils::getGroupsToSync(array(), null, $membership_only = TRUE);
     if (!$groups) {
         // Nothing to do.
         return FALSE;
     }
     // Each list is a task.
     $listCount = 1;
     foreach ($groups as $group_id => $details) {
         $stats[$details['list_id']] = array('mc_count' => 0, 'c_count' => 0, 'in_sync' => 0, 'added' => 0, 'removed' => 0);
         $identifier = "List " . $listCount++ . " " . $details['civigroup_title'];
         $task = new CRM_Queue_Task(array('CRM_Mailchimp_Form_Pull', 'syncPullList'), array($details['list_id'], $identifier), "Preparing queue for {$identifier}");
         // Add the Task to the Queue
         $queue->createItem($task);
     }
     // Setup the Runner
     $runnerParams = array('title' => ts('Import From Mailchimp'), 'queue' => $queue, 'errorMode' => CRM_Queue_Runner::ERROR_ABORT, 'onEndUrl' => CRM_Utils_System::url(self::END_URL, self::END_PARAMS, TRUE, NULL, FALSE));
     // Skip End URL to prevent redirect
     // if calling from cron job
     if ($skipEndUrl == TRUE) {
         unset($runnerParams['onEndUrl']);
     }
     $runner = new CRM_Queue_Runner($runnerParams);
     static::updatePullStats($stats);
     return $runner;
 }
开发者ID:stevekessler,项目名称:uk.co.vedaconsulting.mailchimp,代码行数:33,代码来源:Pull.php

示例2: formatUnitSize

 /**
  * Format size.
  *
  */
 public static function formatUnitSize($size, $checkForPostMax = FALSE)
 {
     if ($size) {
         $last = strtolower($size[strlen($size) - 1]);
         switch ($last) {
             // The 'G' modifier is available since PHP 5.1.0
             case 'g':
                 $size *= 1024;
             case 'm':
                 $size *= 1024;
             case 'k':
                 $size *= 1024;
         }
         if ($checkForPostMax) {
             $maxImportFileSize = self::formatUnitSize(ini_get('upload_max_filesize'));
             $postMaxSize = self::formatUnitSize(ini_get('post_max_size'));
             if ($maxImportFileSize > $postMaxSize && $postMaxSize == $size) {
                 CRM_Core_Session::setStatus(ts("Note: Upload max filesize ('upload_max_filesize') should not exceed Post max size ('post_max_size') as defined in PHP.ini, please check with your system administrator."), ts("Warning"), "alert");
             }
             //respect php.ini upload_max_filesize
             if ($size > $maxImportFileSize && $size !== $postMaxSize) {
                 $size = $maxImportFileSize;
                 CRM_Core_Session::setStatus(ts("Note: Please verify your configuration for Maximum File Size (in MB) <a href='%1'>Administrator >> System Settings >> Misc</a>. It should support 'upload_max_size' as defined in PHP.ini.Please check with your system administrator.", array(1 => CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1'))), ts("Warning"), "alert");
             }
         }
         return $size;
     }
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:32,代码来源:Defaults.php

示例3: process

 /**
  * @param CRM_Core_Form $form
  *
  * @return array
  */
 public static function process(&$form)
 {
     if ($form->getVar('_surveyId') <= 0) {
         return NULL;
     }
     $tabs = array('main' => array('title' => ts('Main Information'), 'link' => NULL, 'valid' => FALSE, 'active' => FALSE, 'current' => FALSE), 'questions' => array('title' => ts('Questions'), 'link' => NULL, 'valid' => FALSE, 'active' => FALSE, 'current' => FALSE), 'results' => array('title' => ts('Results'), 'link' => NULL, 'valid' => FALSE, 'active' => FALSE, 'current' => FALSE));
     $surveyID = $form->getVar('_surveyId');
     $class = $form->getVar('_name');
     $class = CRM_Utils_String::getClassName($class);
     $class = strtolower($class);
     if (array_key_exists($class, $tabs)) {
         $tabs[$class]['current'] = TRUE;
         $qfKey = $form->get('qfKey');
         if ($qfKey) {
             $tabs[$class]['qfKey'] = "&qfKey={$qfKey}";
         }
     }
     if ($surveyID) {
         $reset = !empty($_GET['reset']) ? 'reset=1&' : '';
         foreach ($tabs as $key => $value) {
             if (!isset($tabs[$key]['qfKey'])) {
                 $tabs[$key]['qfKey'] = NULL;
             }
             $tabs[$key]['link'] = CRM_Utils_System::url("civicrm/survey/configure/{$key}", "{$reset}action=update&id={$surveyID}{$tabs[$key]['qfKey']}");
             $tabs[$key]['active'] = $tabs[$key]['valid'] = TRUE;
         }
     }
     return $tabs;
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:34,代码来源:TabHeader.php

示例4: buildForm

 function buildForm(&$form)
 {
     $this->setTitle(ts('Include / Exclude Search'));
     $groups = CRM_Core_PseudoConstant::group();
     $tags = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE));
     if (count($groups) == 0 || count($tags) == 0) {
         CRM_Core_Session::setStatus(ts("At least one Group and Tag must be present for Custom Group / Tag search."), ts('Missing Group/Tag'));
         $url = CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1');
         CRM_Utils_System::redirect($url);
     }
     $inG =& $form->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     $outG =& $form->addElement('advmultiselect', 'excludeGroups', ts('Exclude Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     $andOr = array('1' => ts('Show contacts that meet the Groups criteria AND the Tags criteria'), '0' => ts('Show contacts that meet the Groups criteria OR  the Tags criteria'));
     $form->addRadio('andOr', ts('AND/OR'), $andOr, NULL, '<br />', TRUE);
     $int =& $form->addElement('advmultiselect', 'includeTags', ts('Include Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     $outt =& $form->addElement('advmultiselect', 'excludeTags', ts('Exclude Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
     //add/remove buttons for groups
     $inG->setButtonAttributes('add', array('value' => ts('Add >>')));
     $outG->setButtonAttributes('add', array('value' => ts('Add >>')));
     $inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     $outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     //add/remove buttons for tags
     $int->setButtonAttributes('add', array('value' => ts('Add >>')));
     $outt->setButtonAttributes('add', array('value' => ts('Add >>')));
     $int->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     $outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     /**
      * if you are using the standard template, this array tells the template what elements
      * are part of the search criteria
      */
     $form->assign('elements', array('includeGroups', 'excludeGroups', 'andOr', 'includeTags', 'excludeTags'));
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:32,代码来源:Group.php

示例5: run

 function run()
 {
     $session = CRM_Core_Session::singleton();
     $apiURL = "https://graph.facebook.com/v2.3";
     $redirect_uri = rawurldecode(CRM_Utils_System::url('civicrm/civisocial/facebookcallback', NULL, TRUE));
     // Retreive client_id and client_secret from settings
     $is_enabled = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'enable_facebook'));
     if (!$is_enabled) {
         die("Backend not enabled.");
     }
     $client_secret = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'facebook_secret'));
     $client_id = civicrm_api3('setting', 'getvalue', array('group' => 'CiviSocial Account Credentials', 'name' => 'facebook_app_id'));
     // Facebook sends a code to the callback url, this is further used to acquire
     // access token from facebook, which is needed to get all the data from facebook
     if (array_key_exists('code', $_GET)) {
         $facebook_code = $_GET['code'];
     } else {
         die("FACEBOOK FATAL: the request returned without the code. Please try loging in again.");
     }
     // Get the access token from facebook for the user
     $access_token = "";
     $access_token_response = $this->get_response($apiURL, "oauth/access_token", FALSE, array("client_id" => $client_id, "client_secret" => $client_secret, "code" => $facebook_code, "redirect_uri" => $redirect_uri));
     if (array_key_exists("error", $access_token_response)) {
         die($access_token_response["error"]);
         $access_token = "";
     } else {
         $access_token = $access_token_response["access_token"];
     }
     $user_data_response = $this->get_response($apiURL, "me", FALSE, array("access_token" => $access_token));
     $contact_id = CRM_Civisocial_BAO_CivisocialUser::handle_facebook_data($user_data_response);
     $this->assign('status', $contact_id);
     $session->set('userID', $contact_id);
     parent::run();
 }
开发者ID:rolencea,项目名称:org.civicrm.civisocial2,代码行数:34,代码来源:FacebookCallback.php

示例6: postProcess

 public function postProcess()
 {
     $values = $this->exportValues();
     // check if EmailTyped matches Email address
     $result = CRM_Utils_String::compareStr($this->_email, $values['email_confirm'], TRUE);
     $job_id = $this->_job_id;
     $queue_id = $this->_queue_id;
     $hash = $this->_hash;
     $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}", "reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
     $this->assign('confirmURL', $confirmURL);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext($confirmURL);
     if ($result == TRUE) {
         // Email address verified
         if (CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_domain($job_id, $queue_id, $hash)) {
             CRM_Mailing_Event_BAO_Unsubscribe::send_unsub_response($queue_id, NULL, TRUE, $job_id);
         }
         $statusMsg = ts('Email: %1 has been successfully opted out', array(1 => $values['email_confirm']));
         CRM_Core_Session::setStatus($statusMsg, '', 'success');
     } elseif ($result == FALSE) {
         // Email address not verified
         $statusMsg = ts('The email address: %1 you have entered does not match the email associated with this opt out request.', array(1 => $values['email_confirm']));
         CRM_Core_Session::setStatus($statusMsg, '', 'fail');
     }
 }
开发者ID:kidaa30,项目名称:yes,代码行数:25,代码来源:Optout.php

示例7: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'label_a_b', ts('Relationship Label-A to B'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'label_a_b'), true);
     $this->addRule('label_a_b', ts('Label already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_RelationshipType', $this->_id, 'label_a_b'));
     $this->add('text', 'label_b_a', ts('Relationship Label-B to A'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'label_b_a'));
     $this->addRule('label_b_a', ts('Label already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_RelationshipType', $this->_id, 'label_b_a'));
     $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'description'));
     require_once 'CRM/Contact/BAO/ContactType.php';
     $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
     // add select for contact type
     $contactTypeA =& $this->add('select', 'contact_types_a', ts('Contact Type A') . ' ', array('' => ts('- select -')) + $contactTypes);
     $contactTypeB =& $this->add('select', 'contact_types_b', ts('Contact Type B') . ' ', array('' => ts('- select -')) + $contactTypes);
     $isActive =& $this->add('checkbox', 'is_active', ts('Enabled?'));
     //only selected field should be allow for edit, CRM-4888
     if ($this->_id && CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $this->_id, 'is_reserved')) {
         foreach (array('contactTypeA', 'contactTypeB', 'isActive') as $field) {
             ${$field}->freeze();
         }
     }
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->freeze();
         $url = CRM_Utils_System::url('civicrm/admin/reltype&reset=1');
         $location = "window.location='{$url}'";
         $this->addElement('button', 'done', ts('Done'), array('onclick' => $location));
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:37,代码来源:RelationshipType.php

示例8: postProcess

 public function postProcess()
 {
     $session = CRM_Core_Session::singleton();
     $session->setStatus('Rule ' . $this->rule->label . ' parameters updated', 'Rule parameters updated', 'success');
     $redirectUrl = CRM_Utils_System::url('civicrm/civirule/form/rule', 'action=update&id=' . $this->rule->id, TRUE);
     CRM_Utils_System::redirect($redirectUrl);
 }
开发者ID:alejandro-ixiam,项目名称:org.civicoop.civirules,代码行数:7,代码来源:Form.php

示例9: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     $instanceId = CRM_Report_Utils_Report::getInstanceID();
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
     $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
     if ($action & CRM_Core_Action::DELETE) {
         if (!CRM_Core_Permission::check('administer Reports')) {
             $statusMessage = ts('Your do not have permission to Delete Report.');
             CRM_Core_Error::statusBounce($statusMessage, $reportUrl);
         }
         CRM_Report_BAO_Instance::delete($instanceId);
         CRM_Core_Session::setStatus(ts('Selected Instance has been deleted.'));
     } else {
         require_once 'CRM/Core/OptionGroup.php';
         $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
         if (strstr($templateInfo['name'], '_Form')) {
             $instanceInfo = array();
             CRM_Report_BAO_Instance::retrieve(array('id' => $instanceId), $instanceInfo);
             if (!empty($instanceInfo['title'])) {
                 CRM_Utils_System::setTitle($instanceInfo['title']);
                 $this->assign('reportTitle', $instanceInfo['title']);
             } else {
                 CRM_Utils_System::setTitle($templateInfo['label']);
                 $this->assign('reportTitle', $templateInfo['label']);
             }
             $wrapper =& new CRM_Utils_Wrapper();
             return $wrapper->run($templateInfo['name'], null, null);
         }
         CRM_Core_Session::setStatus(ts('Could not find template for the instance.'));
     }
     return CRM_Utils_System::redirect($reportUrl);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:38,代码来源:Instance.php

示例10: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm($check = FALSE)
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $types = CRM_Booking_BAO_Resource::buildOptions('type_id', 'create');
     $this->add('select', 'type_id', ts('Resource type'), array('' => ts('- select -')) + $types, TRUE, array());
     $this->add('text', 'label', ts('Label'), array('size' => 50, 'maxlength' => 255), TRUE);
     $this->add('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Booking_DAO_Resource', 'description'), FALSE);
     /*
         $this->addWysiwyg('description',
             ts('Description'),
             CRM_Core_DAO::getAttribute('CRM_Booking_DAO_Resource', 'description')
         );*/
     $this->add('text', 'weight', ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Booking_DAO_Resource', 'weight'), TRUE);
     $this->add('checkbox', 'is_active', ts('Enabled?'));
     $this->add('checkbox', 'is_unlimited', ts('Is Unlimited?'));
     $configSets = array('' => ts('- select -'));
     try {
         $activeSets = civicrm_api3('ResourceConfigSet', 'get', array('is_active' => 1, 'is_deleted' => 0));
         foreach ($activeSets['values'] as $key => $set) {
             $configSets[$key] = $set['title'];
         }
     } catch (CiviCRM_API3_Exception $e) {
     }
     $this->add('select', 'set_id', ts('Resource configuration set'), $configSets, TRUE);
     $locations = CRM_Booking_BAO_Resource::buildOptions('location_id', 'create');
     $this->add('select', 'location_id', ts('Resource Location'), array('' => ts('- select -')) + $locations, FALSE, array());
     $this->addFormRule(array('CRM_Admin_Form_Resource', 'formRule'), $this);
     $cancelURL = CRM_Utils_System::url('civicrm/admin/resource', "&reset=1");
     $cancelURL = str_replace('&amp;', '&', $cancelURL);
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'), 'js' => array('onclick' => "location.href='{$cancelURL}'; return false;"))));
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:40,代码来源:Resource.php

示例11: preProcess

 public function preProcess()
 {
     require_once 'CRM/Contact/BAO/SearchCustom.php';
     $csID = CRM_Utils_Request::retrieve('csid', 'Integer', $this);
     $ssID = CRM_Utils_Request::retrieve('ssID', 'Integer', $this);
     $gID = CRM_Utils_Request::retrieve('gid', 'Integer', $this);
     list($this->_customSearchID, $this->_customSearchClass, $formValues) = CRM_Contact_BAO_SearchCustom::details($csID, $ssID, $gID);
     if (!$this->_customSearchID) {
         CRM_Core_Error::fatal('Could not get details for custom search.');
     }
     if (!empty($formValues)) {
         $this->_formValues = $formValues;
     }
     // set breadcrumb to return to Custom Search listings page
     $breadCrumb = array(array('title' => ts('Custom Searches'), 'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1')));
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     // use the custom selector
     require_once 'CRM/Contact/Selector/Custom.php';
     $this->_selectorName = 'CRM_Contact_Selector_Custom';
     $this->set('customSearchID', $this->_customSearchID);
     $this->set('customSearchClass', $this->_customSearchClass);
     parent::preProcess();
     // instantiate the new class
     eval('$this->_customClass = new ' . $this->_customSearchClass . '( $this->_formValues );');
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:25,代码来源:Custom.php

示例12: postProcess

 static function postProcess(&$form)
 {
     $values = $form->exportValues();
     $teamId = $values['pcp_team_contact'];
     $teampcpId = CRM_Pcpteams_Utils::getPcpIdByContactAndEvent($form->get('component_page_id'), $teamId);
     $userId = CRM_Pcpteams_Utils::getloggedInUserId();
     // Create Team Member of relation to this Team
     $cfpcpab = CRM_Pcpteams_Utils::getPcpABCustomFieldId();
     $cfpcpba = CRM_Pcpteams_Utils::getPcpBACustomFieldId();
     $customParams = array("custom_{$cfpcpab}" => $form->get('page_id'), "custom_{$cfpcpba}" => $teampcpId);
     CRM_Pcpteams_Utils::createTeamRelationship($userId, $teamId, $customParams);
     $form->_teamName = CRM_Contact_BAO_Contact::displayName($teamId);
     $form->set('teamName', $form->_teamName);
     $form->set('teamContactID', $teamId);
     $form->set('teamPcpId', $teampcpId);
     $teamAdminId = CRM_Pcpteams_Utils::getTeamAdmin($teampcpId);
     // Team Join: create activity
     $actParams = array('target_contact_id' => $teamId, 'assignee_contact_id' => $teamAdminId);
     CRM_Pcpteams_Utils::createPcpActivity($actParams, CRM_Pcpteams_Constant::C_AT_REQ_MADE);
     CRM_Core_Session::setStatus(ts('A notification has been sent to the team. Once approved, team should be visible on your page.'), ts('Team Request Sent'));
     //send email once the team request has done.
     list($teamAdminName, $teamAdminEmail) = CRM_Contact_BAO_Contact::getContactDetails($teamAdminId);
     $contactDetails = civicrm_api('Contact', 'get', array('version' => 3, 'sequential' => 1, 'id' => $userId));
     $emailParams = array('tplParams' => array('teamAdminName' => $teamAdminName, 'userFirstName' => $contactDetails['values'][0]['first_name'], 'userlastName' => $contactDetails['values'][0]['last_name'], 'teamName' => $form->_teamName, 'pageURL' => CRM_Utils_System::url('civicrm/pcp/manage', "reset=1&id={$teampcpId}", TRUE, NULL, FALSE, TRUE)), 'email' => array($teamAdminName => array('first_name' => $teamAdminName, 'last_name' => $teamAdminName, 'email-Primary' => $teamAdminEmail, 'display_name' => $teamAdminName)), 'valueName' => CRM_Pcpteams_Constant::C_MSG_TPL_JOIN_REQUEST);
     $sendEmail = CRM_Pcpteams_Utils::sendMail($userId, $emailParams);
 }
开发者ID:eruraindil,项目名称:uk.co.vedaconsulting.pcpteams,代码行数:26,代码来源:TeamJoin.php

示例13: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     $args = func_get_args();
     $check = reset($args);
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
     foreach ($this->_settings as $setting => $group) {
         $settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
         $props = $settingMetaData['values'][$setting];
         if (isset($props['quick_form_type'])) {
             $add = 'add' . $props['quick_form_type'];
             if ($add == 'addElement') {
                 $this->{$add}($props['html_type'], $setting, ts($props['title']), CRM_Utils_Array::value($props['html_type'] == 'select' ? 'option_values' : 'html_attributes', $props, array()), $props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL);
             } elseif ($add == 'addSelect') {
                 $options = civicrm_api3('Setting', 'getoptions', array('field' => $setting));
                 $this->addElement('select', $setting, ts($props['title']), $options['values'], CRM_Utils_Array::value('html_attributes', $props));
             } else {
                 $this->{$add}($setting, ts($props['title']));
             }
             $this->assign("{$setting}_description", ts($props['description']));
             if ($setting == 'max_attachments') {
                 //temp hack @todo fix to get from metadata
                 $this->addRule('max_attachments', ts('Value should be a positive number'), 'positiveInteger');
             }
             if ($setting == 'maxFileSize') {
                 //temp hack
                 $this->addRule('maxFileSize', ts('Value should be a positive number'), 'positiveInteger');
             }
         }
     }
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:35,代码来源:Setting.php

示例14: normalize_civicrm_enable

/**
 * Implementation of hook_civicrm_enable
 */
function normalize_civicrm_enable()
{
    // jump to the setup screen after enabling extension
    $session = CRM_Core_Session::singleton();
    $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/setting/reformat'));
    return _normalize_civix_civicrm_enable();
}
开发者ID:progressivetech,项目名称:com.cividesk.normalize,代码行数:10,代码来源:normalize.php

示例15: run

 /**
  * run this page (figure out the action needed and perform it).
  *
  * @return void
  */
 function run()
 {
     if (!CRM_Core_Permission::check('administer Reports')) {
         return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
     }
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl();
     $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value', 'String', FALSE);
     $extKey = strpos(CRM_Utils_Array::value('name', $templateInfo), '.');
     $reportClass = NULL;
     if ($extKey !== FALSE) {
         $ext = CRM_Extension_System::singleton()->getMapper();
         $reportClass = $ext->keyToClass($templateInfo['name'], 'report');
         $templateInfo['name'] = $reportClass;
     }
     if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form') || !is_null($reportClass)) {
         CRM_Utils_System::setTitle($templateInfo['label'] . ' - Template');
         $this->assign('reportTitle', $templateInfo['label']);
         $session = CRM_Core_Session::singleton();
         $session->set('reportDescription', $templateInfo['description']);
         $wrapper = new CRM_Utils_Wrapper();
         return $wrapper->run($templateInfo['name'], NULL, NULL);
     }
     if ($optionVal) {
         CRM_Core_Session::setStatus(ts('Could not find the report template. Make sure the report template is registered and / or url is correct.'), ts('Template Not Found'), 'error');
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1'));
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:32,代码来源:Report.php


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