本文整理汇总了PHP中CRM_Core_Controller_Simple::getTemplateFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Controller_Simple::getTemplateFileName方法的具体用法?PHP CRM_Core_Controller_Simple::getTemplateFileName怎么用?PHP CRM_Core_Controller_Simple::getTemplateFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Controller_Simple
的用法示例。
在下文中一共展示了CRM_Core_Controller_Simple::getTemplateFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* run this page (figure out the action needed and perform it).
*
* @return void
*/
function run()
{
$this->preProcess();
$this->assign('recentlyViewed', false);
if ($this->_gid) {
$ufgroupDAO = new CRM_Core_DAO_UFGroup();
$ufgroupDAO->id = $this->_gid;
if (!$ufgroupDAO->find(true)) {
CRM_Core_Error::fatal();
}
}
if ($this->_gid) {
// set the title of the page
if ($ufgroupDAO->title) {
CRM_Utils_System::setTitle($ufgroupDAO->title);
}
}
$this->assign('isReset', true);
$formController = new CRM_Core_Controller_Simple('CRM_Profile_Form_Search', ts('Search Profile'), CRM_Core_Action::ADD);
$formController->setEmbedded(true);
$formController->set('gid', $this->_gid);
$formController->process();
$searchError = false;
// check if there is a POST
if (!empty($_POST)) {
if ($formController->validate() !== true) {
$searchError = true;
}
}
// also get the search tpl name
$this->assign('searchTPL', $formController->getTemplateFileName());
$this->assign('search', $this->_search);
// search if search returned a form error?
if ((!CRM_Utils_Array::value('reset', $_GET) || CRM_Utils_Array::value('force', $_GET)) && !$searchError) {
$this->assign('isReset', false);
$gidString = $this->_gid;
if (empty($this->_profileIds)) {
$gids = $this->_gid;
} else {
$gids = $this->_profileIds;
$gidString = implode(',', $this->_profileIds);
}
$map = 0;
$linkToUF = 0;
$editLink = false;
if ($this->_gid) {
$map = $ufgroupDAO->is_map;
$linkToUF = $ufgroupDAO->is_uf_link;
$editLink = $ufgroupDAO->is_edit_link;
}
if ($map) {
$this->assign('mapURL', CRM_Utils_System::url('civicrm/profile/map', "map=1&gid={$gidString}&reset=1"));
}
if (CRM_Utils_Array::value('group', $this->_params)) {
foreach ($this->_params['group'] as $key => $val) {
if (!$val) {
unset($this->_params['group'][$key]);
}
}
}
// the selector will override this if the user does have
// edit permissions as determined by the mask, CRM-4341
// do not allow edit for anon users in joomla frontend, CRM-4668
$config = CRM_Core_Config::singleton();
if (!CRM_Core_Permission::check('access CiviCRM') || $config->userFrameworkFrontend == 1) {
$editLink = false;
}
$selector = new CRM_Profile_Selector_Listings($this->_params, $this->_customFields, $gids, $map, $editLink, $linkToUF);
$controller = new CRM_Core_Selector_Controller($selector, $this->get(CRM_Utils_Pager::PAGE_ID), $this->get(CRM_Utils_Sort::SORT_ID), CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::TEMPLATE);
$controller->setEmbedded(true);
$controller->run();
}
//CRM-6862 -run form cotroller after
//selector, since it erase $_POST
$formController->run();
return parent::run();
}