本文整理汇总了PHP中ts函数的典型用法代码示例。如果您正苦于以下问题:PHP ts函数的具体用法?PHP ts怎么用?PHP ts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ts函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
parent::buildQuickForm();
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), array('' => ts('- select -')) + $multipleCustomData, TRUE);
$this->addContactTypeSelector();
}
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:12,代码来源:DataSource.php
示例2: array
/**
* Get action Links
*
* @return array (reference) of action links
*/
function &links()
{
if (!self::$_links) {
self::$_links = array(CRM_Core_Action::BROWSE => array('name' => ts('Accounts'), 'url' => 'civicrm/admin/financial/financialType/accounts', 'qs' => 'reset=1&action=browse&aid=%%id%%', 'title' => ts('Accounts')), CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/financial/financialType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Financial Type')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_FinancialType' . '\',\'' . 'enable-disable' . '\' );"', 'ref' => 'disable-action', 'title' => ts('Disable Financial Type')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_FinancialType' . '\',\'' . 'disable-enable' . '\' );"', 'ref' => 'enable-action', 'title' => ts('Enable Financial Type')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/financial/financialType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Financial Type')));
}
return self::$_links;
}
开发者ID:hguru,项目名称:224Civi,代码行数:12,代码来源:FinancialType.php
示例3: buildQuickForm
/**
* Build the form - it consists of
* - displaying the QILL (query in local language)
* - displaying elements for saving the search
*
* @access public
* @return void
*/
function buildQuickForm()
{
//
// just need to add a javacript to popup the window for printing
//
$this->addButtons(array(array('type' => 'next', 'name' => ts('Print Pledge List'), 'js' => array('onclick' => 'window.print()'), 'isDefault' => true), array('type' => 'back', 'name' => ts('Done'))));
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:15,代码来源:Print.php
示例4: civicrm_api3_membership_status_update
/**
* Update an existing membership status.
*
* This api is used for updating an existing membership status.
* Required parameters: id of a membership status
*
* @param array $params
* Array of name/value property values of civicrm_membership_status.
*
* @deprecated - should just use create
*
* @return array
* Array of updated membership status property values
*/
function civicrm_api3_membership_status_update($params)
{
civicrm_api3_verify_mandatory($params, NULL, array('id'));
//don't allow duplicate names.
$name = CRM_Utils_Array::value('name', $params);
if ($name) {
$status = new CRM_Member_DAO_MembershipStatus();
$status->name = $params['name'];
if ($status->find(TRUE) && $status->id != $params['id']) {
return civicrm_api3_create_error(ts('A membership status with this name already exists.'));
}
}
$membershipStatusBAO = new CRM_Member_BAO_MembershipStatus();
$membershipStatusBAO->id = $params['id'];
if ($membershipStatusBAO->find(TRUE)) {
$fields = $membershipStatusBAO->fields();
foreach ($fields as $name => $field) {
if (array_key_exists($name, $params)) {
$membershipStatusBAO->{$name} = $params[$name];
}
}
$membershipStatusBAO->save();
}
$membershipStatus = array();
_civicrm_api3_object_to_array(clone $membershipStatusBAO, $membershipStatus);
$membershipStatus['is_error'] = 0;
return $membershipStatus;
}
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:42,代码来源:MembershipStatus.php
示例5: run
function run()
{
$upgrade = new CRM_Upgrade_Form();
$message = ts('CiviCRM upgrade successful');
if ($upgrade->checkVersion($upgrade->latestVersion)) {
$message = ts('Your database has already been upgraded to CiviCRM %1', array(1 => $upgrade->latestVersion));
} elseif ($upgrade->checkVersion('2.1.2') || $upgrade->checkVersion('2.1.3') || $upgrade->checkVersion('2.1.4') || $upgrade->checkVersion('2.1.5')) {
// do nothing, db version is changed for all upgrades
} elseif ($upgrade->checkVersion('2.1.0') || $upgrade->checkVersion('2.1') || $upgrade->checkVersion('2.1.1')) {
// 2.1 to 2.1.2
$this->runTwoOneTwo();
} else {
// 2.0 to 2.1
for ($i = 1; $i <= 4; $i++) {
$this->runForm($i);
}
// 2.1 to 2.1.2
$this->runTwoOneTwo();
}
// just change the ver in the db, since nothing to upgrade
$upgrade->setVersion($upgrade->latestVersion);
// also cleanup the templates_c directory
$config = CRM_Core_Config::singleton();
$config->cleanup(1);
$template = CRM_Core_Smarty::singleton();
$template->assign('message', $message);
$template->assign('pageTitle', ts('Upgrade CiviCRM to Version %1', array(1 => $upgrade->latestVersion)));
$template->assign('menuRebuildURL', CRM_Utils_System::url('civicrm/menu/rebuild', 'reset=1'));
$contents = $template->fetch('CRM/common/success.tpl');
echo $contents;
}
开发者ID:hguru,项目名称:224Civi,代码行数:31,代码来源:Upgrade.php
示例6: buildQuickForm
/**
* build the form elements for an email object
*
* @return void
* @access public
*/
public function buildQuickForm()
{
CRM_Contact_Form_Edit_CommunicationPreferences::buildQuickForm($this);
$this->addFormRule(array('CRM_Contact_Form_Edit_CommunicationPreferences', 'formRule'), $this);
$buttons = array(array('type' => 'upload', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel')));
$this->addButtons($buttons);
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:13,代码来源:CommunicationPreferences.php
示例7: array
/**
* Get action Links
*
* @return array (reference) of action links
*/
function &links()
{
if (!self::$_links) {
self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/paymentProcessorType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Payment ProcessorType')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Payment ProcessorType')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Payment ProcessorType')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/paymentProcessorType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Payment ProcessorType')));
}
return self::$_links;
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:12,代码来源:PaymentProcessorType.php
示例8: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
CRM_Utils_System::setTitle(ts('Add Contacts to Organization'));
$this->addElement('text', 'name', ts('Find Target Organization'));
$this->add('select', 'relationship_type_id', ts('Relationship Type'), array('' => ts('- select -')) + CRM_Contact_BAO_Relationship::getRelationType("Organization"), TRUE);
$searchRows = $this->get('searchRows');
$searchCount = $this->get('searchCount');
if ($searchRows) {
$checkBoxes = array();
$chekFlag = 0;
foreach ($searchRows as $id => $row) {
if (!$chekFlag) {
$chekFlag = $id;
}
$checkBoxes[$id] = $this->createElement('radio', NULL, NULL, NULL, $id);
}
$this->addGroup($checkBoxes, 'contact_check');
if ($chekFlag) {
$checkBoxes[$chekFlag]->setChecked(TRUE);
}
$this->assign('searchRows', $searchRows);
}
$this->assign('searchCount', $searchCount);
$this->assign('searchDone', $this->get('searchDone'));
$this->assign('contact_type_display', ts('Organization'));
$this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), array('class' => 'crm-form-submit'));
$this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'crm-form-submit'));
$this->addButtons(array(array('type' => 'next', 'name' => ts('Add to Organization'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:32,代码来源:AddToOrganization.php
示例9: addRelationships
/**
* Add relationships from form.
*/
public function addRelationships()
{
if (!is_array($this->_contactIds)) {
// Could this really happen?
return;
}
$relationshipTypeParts = explode('_', $this->params['relationship_type_id']);
$params = array('relationship_type_id' => $relationshipTypeParts[0], 'is_active' => 1);
$secondaryRelationshipSide = $relationshipTypeParts[1];
$primaryRelationshipSide = $relationshipTypeParts[2];
$primaryFieldName = 'contact_id_' . $primaryRelationshipSide;
$secondaryFieldName = 'contact_id_' . $secondaryRelationshipSide;
$relationshipLabel = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $params['relationship_type_id'], "label_{$secondaryRelationshipSide}_{$primaryRelationshipSide}");
$params[$secondaryFieldName] = $this->_contactIds;
$params[$primaryFieldName] = $this->params['contact_check'];
$outcome = CRM_Contact_BAO_Relationship::createMultiple($params, $primaryRelationshipSide);
$relatedContactName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $params[$primaryFieldName], 'display_name');
$status = array(ts('%count %2 %3 relationship created', array('count' => $outcome['valid'], 'plural' => '%count %2 %3 relationships created', 2 => $relationshipLabel, 3 => $relatedContactName)));
if ($outcome['duplicate']) {
$status[] = ts('%count was skipped because the contact is already %2 %3', array('count' => $outcome['duplicate'], 'plural' => '%count were skipped because the contacts are already %2 %3', 2 => $relationshipLabel, 3 => $relatedContactName));
}
if ($outcome['invalid']) {
$status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array('count' => $outcome['invalid'], 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship'));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('Relationship created.', array('count' => $outcome['valid'], 'plural' => 'Relationships created.')), 'success', array('expires' => 0));
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:30,代码来源:AddToParentClass.php
示例10: array
/**
* Get action Links
*
* @return array (reference) of action links
*/
function &links()
{
if (!self::$_links) {
self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => CRM_Utils_System::currentPath(), 'qs' => 'action=update&id=%%id%%', 'title' => ts('Edit Mailing Component')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Mailing_BAO_Component' . '\',\'' . 'enable-disable' . '\' );"', 'ref' => 'disable-action', 'title' => ts('Disable Mailing Component')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Mailing_BAO_Component' . '\',\'' . 'disable-enable' . '\' );"', 'ref' => 'enable-action', 'title' => ts('Enable Mailing Component')));
}
return self::$_links;
}
开发者ID:ksecor,项目名称:civicrm,代码行数:12,代码来源:Component.php
示例11: run
public function run()
{
$eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE);
$fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
$quest = CRM_Utils_Request::retrieve('quest', 'String', $this);
$action = CRM_Utils_Request::retrieve('action', 'String', $this);
list($path, $mimeType) = CRM_Core_BAO_File::path($id, $eid, NULL, $quest);
if (!$path) {
CRM_Core_Error::statusBounce('Could not retrieve the file');
}
$buffer = file_get_contents($path);
if (!$buffer) {
CRM_Core_Error::statusBounce('The file is either empty or you do not have permission to retrieve the file');
}
if ($action & CRM_Core_Action::DELETE) {
if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', CRM_Core_DAO::$_nullObject)) {
CRM_Core_BAO_File::deleteFileReferences($id, $eid, $fid);
CRM_Core_Session::setStatus(ts('The attached file has been deleted.'), ts('Complete'), 'success');
$session = CRM_Core_Session::singleton();
$toUrl = $session->popUserContext();
CRM_Utils_System::redirect($toUrl);
}
} else {
CRM_Utils_System::download(CRM_Utils_File::cleanFileName(basename($path)), $mimeType, $buffer);
}
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:27,代码来源:File.php
示例12: array
/**
* Get action Links
*
* @return array (reference) of action links
*/
function &links()
{
if (!self::$_links) {
self::$_links = array(CRM_Core_Action::BROWSE => array('name' => ts('Multiple Choice Options'), 'url' => 'civicrm/admin/optionValue', 'qs' => 'reset=1&action=browse&gid=%%id%%', 'title' => ts('View and Edit Multiple Choice Options')), CRM_Core_Action::UPDATE => array('name' => ts('Edit Group'), 'url' => 'civicrm/admin/optionGroup', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Option')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionGroup' . '\',\'' . 'enable-disable' . '\' );"', 'ref' => 'disable-action', 'title' => ts('Disable Option')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionGroup' . '\',\'' . 'disable-enable' . '\' );"', 'ref' => 'enable-action', 'title' => ts('Enable Option')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/optionGroup', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Option')));
}
return self::$_links;
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:12,代码来源:OptionGroup.php
示例13: run
function run()
{
$sql = "SELECT * FROM civicrm_metrics_server ORDER BY site_name, timestamp";
$dao =& CRM_Core_DAO::executeQuery($sql);
$rows = array();
while ($dao->fetch()) {
$row = array();
$row['id'] = $dao->id;
$row['site_name'] = $dao->site_name;
$row['site_url'] = $dao->site_url;
$row['timestamp'] = $dao->timestamp;
$row['type'] = $dao->type;
$row['data'] = $dao->data;
$rows[] = $row;
}
if (array_key_exists("export", $_REQUEST) && $_REQUEST['export'] == 'csv') {
header('Content-type: text/csv');
header('Content-disposition: attachment;filename=metrics_data_' . date("Ymd_HiO") . '.csv');
$output = fopen('php://output', 'w');
$headers = array("Id", "Site Name", "Site URL", "Timestamp", "Metric Type", "Metric Data");
fputcsv($output, $headers);
foreach ($rows as $row) {
fputcsv($output, $row);
}
fclose($output);
die;
} else {
CRM_Utils_System::setTitle(ts('Metrics Report'));
$this->assign('data', $rows);
$this->assign('headers', array_keys($rows[0]));
parent::run();
}
}
开发者ID:TobiasLounsbury,项目名称:civicrm-metrics-server,代码行数:33,代码来源:Report.php
示例14: _validateParams
/**
* Function to validate parameters
*
* @param array $params
* @return string $errorMessage
*/
function _validateParams($params)
{
$errorMessage = '';
if (!isset($params['id']) && empty($params['label'])) {
return ts('Label can not be empty when adding a new CiviRule Trigger');
}
if (_checkClassNameObjectNameOperation($params) == FALSE) {
return ts('Either class_name or a combination of object_name and op is mandatory');
}
if (isset($params['cron']) && $params['cron'] == 1) {
$params['object_name'] = null;
$params['op'] = null;
if (!isset($params['class_name']) || empty($params['class_name'])) {
return ts('For a cron type trigger the class_name is mandatory');
}
}
if (isset($params['object_name']) && !empty($params['object_name'])) {
$extensionConfig = CRM_Civirules_Config::singleton();
if (!in_array($params['object_name'], $extensionConfig->getValidTriggerObjectNames())) {
return ts('ObjectName passed in parameters (' . $params['object_name'] . ')is not a valid object for a CiviRule Trigger');
}
}
if (isset($params['op']) && !empty($params['op'])) {
$extensionConfig = CRM_Civirules_Config::singleton();
if (!in_array($params['op'], $extensionConfig->getValidTriggerOperations())) {
return ts('Operation passed in parameters (' . $params['op'] . ')is not a valid operation for a CiviRule Trigger');
}
}
if (CRM_Civirules_BAO_Trigger::triggerExists($params) == TRUE) {
return ts('There is already a trigger for this class_name or combination of object_name and op');
}
return $errorMessage;
}
开发者ID:alejandro-ixiam,项目名称:org.civicoop.civirules,代码行数:39,代码来源:Create.php
示例15: preProcess
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function preProcess()
{
// Make sure case types have been configured for the component
require_once 'CRM/Core/OptionGroup.php';
$caseType = CRM_Core_OptionGroup::values('case_type');
if (empty($caseType)) {
$this->assign('notConfigured', 1);
return;
}
$session =& CRM_Core_Session::singleton();
$allCases = CRM_Utils_Request::retrieve('all', 'Positive', $session);
CRM_Utils_System::setTitle(ts('CiviCase Dashboard'));
$userID = $session->get('userID');
if (!$allCases) {
$this->assign('myCases', true);
} else {
$this->assign('myCases', false);
}
$this->assign('newClient', false);
if (CRM_Core_Permission::check('add contacts')) {
$this->assign('newClient', true);
}
require_once 'CRM/Case/BAO/Case.php';
$summary = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
$upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
$recent = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
$this->assign('casesSummary', $summary);
if (!empty($upcoming)) {
$this->assign('upcomingCases', $upcoming);
}
if (!empty($recent)) {
$this->assign('recentCases', $recent);
}
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:42,代码来源:DashBoard.php
示例16: array
/**
* Get action Links.
*
* @return array
* (reference) of action links
*/
public function &links()
{
if (!self::$_links) {
self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/badgelayout', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Badge Layout')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Badge Layout')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Badge Layout')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/badgelayout', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Badge Layout')));
}
return self::$_links;
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:13,代码来源:Layout.php
示例17: operation
static function operation()
{
if (!self::$_operation) {
self::$_operation = array('View' => ts('View'), 'Edit' => ts('Edit'), 'Create' => ts('Create'), 'Delete' => ts('Delete'), 'Search' => ts('Search'), 'All' => ts('All'));
}
return self::$_operation;
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:7,代码来源:ACL.php
示例18: 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
示例19: statelegemail_civicrm_navigationMenu
/**
* Implements hook_civicrm_navigationMenu().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
*/
function statelegemail_civicrm_navigationMenu(&$menu)
{
// We'd like the item to be beneath these two items.
$idealTree = array('Administer', 'CiviCampaign');
// Walk down the menu to see if we can find them where we expect them.
$walkMenu = $menu;
$branches = array();
foreach ($idealTree as $limb) {
foreach ($walkMenu as $id => $item) {
if ($item['attributes']['name'] == $limb) {
$walkMenu = CRM_Utils_Array::value('child', $item, array());
$branches[] = $id;
$branches[] = 'child';
continue 2;
}
}
// If the expected parent isn't at this level of the menu, we'll just drop
// it here.
break;
}
$item = array('attributes' => array('label' => ts('State Legislators Email Settings', array('domain' => 'com.aghstrategies.statelegemail')), 'name' => 'statelegemail_settings', 'url' => 'civicrm/statelegemail/settings?reset=1', 'permission' => 'administer CiviCRM', 'operator' => 'AND', 'separator' => 0, 'active' => 1));
if (!empty($id)) {
$item['parentID'] = $id;
}
// Need to put together exactly where the item should be added;
$treeMenu =& $menu;
foreach ($branches as $branch) {
$treeMenu =& $treeMenu[$branch];
}
$newId = 0;
statelegemail_scanMaxNavId($menu, $newId);
$newId++;
$item['navID'] = $newId;
$treeMenu[$newId] = $item;
}
开发者ID:aghstrategies,项目名称:com.aghstrategies.statelegemail,代码行数:40,代码来源:statelegemail.php
示例20: alterDisplay
/**
* Alter display of rows.
*
* Iterate through the rows retrieved via SQL and make changes for display purposes,
* such as rendering contacts as links.
*
* @param array $rows
* Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows)
{
// cache for id → is_deleted mapping
$isDeleted = array();
foreach ($rows as &$row) {
if (!isset($isDeleted[$row['civicrm_contact_is_deleted']])) {
$isDeleted[$row['civicrm_contact_is_deleted']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['civicrm_contact_altered_contact_id'], 'is_deleted') !== '0';
}
if (!$isDeleted[$row['civicrm_contact_is_deleted']]) {
$row['civicrm_contact_altered_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_contact_id']);
$row['civicrm_contact_altered_contact_display_name_hover'] = ts('Go to contact summary');
}
$row['civicrm_contact_altered_by_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_log_user_id']);
$row['civicrm_contact_altered_by_display_name_hover'] = ts('Go to contact summary');
if ($row['civicrm_contact_altered_contact_is_deleted'] and $row['log_civicrm_contribution_log_action'] == 'Update') {
$row['log_civicrm_contribution_log_action'] = ts('Delete');
}
if ($row['log_civicrm_contribution_log_action'] == 'Update') {
$q = "reset=1&log_conn_id={$row['log_civicrm_contribution_log_conn_id']}&log_date={$row['log_civicrm_contribution_log_date']}";
if ($this->cid) {
$q .= '&cid=' . $this->cid;
}
$url = CRM_Report_Utils_Report::getNextUrl('logging/contribute/detail', $q, FALSE, TRUE);
$row['log_civicrm_contribution_log_action_link'] = $url;
$row['log_civicrm_contribution_log_action_hover'] = ts('View details for this update');
$row['log_civicrm_contribution_log_action'] = '<div class="icon ui-icon-zoomin"></div> ' . ts('Update');
}
unset($row['log_civicrm_contribute_log_user_id']);
unset($row['log_civicrm_contribute_log_conn_id']);
}
}
开发者ID:nganivet,项目名称:civicrm-core,代码行数:40,代码来源:LoggingSummary.php
注:本文中的ts函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论