Exemplo n.º 1
0
 /**
  * @param string $suffix
  *
  * @return null|string
  */
 public function checkTemplateFileExists($suffix = '')
 {
     if ($this->_gid) {
         $templateFile = "CRM/Profile/Page/{$this->_gid}/Dynamic.{$suffix}tpl";
         $template = CRM_Core_Page::getTemplate();
         if ($template->template_exists($templateFile)) {
             return $templateFile;
         }
         // lets see if we have customized by name
         $ufGroupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'name');
         if ($ufGroupName) {
             $templateFile = "CRM/Profile/Page/{$ufGroupName}/Dynamic.{$suffix}tpl";
             if ($template->template_exists($templateFile)) {
                 return $templateFile;
             }
         }
     }
     return NULL;
 }
Exemplo n.º 2
0
 function getTemplateFileName()
 {
     if ($this->_gid) {
         $templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.tpl";
         $template =& CRM_Core_Page::getTemplate();
         if ($template->template_exists($templateFile)) {
             return $templateFile;
         }
     }
     return parent::getTemplateFileName();
 }
Exemplo n.º 3
0
 function getTemplateFileName()
 {
     if ($this->_id) {
         $templateFile = "CRM/Event/Page/{$this->_id}/EventInfo.tpl";
         $template =& CRM_Core_Page::getTemplate();
         if ($template->template_exists($templateFile)) {
             return $templateFile;
         }
     }
     return parent::getTemplateFileName();
 }
Exemplo n.º 4
0
 function getTemplateFileName()
 {
     if ($this->_gid) {
         $templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.tpl";
         $template =& CRM_Core_Page::getTemplate();
         if ($template->template_exists($templateFile)) {
             return $templateFile;
         }
         // lets see if we have customized by name
         $ufGroupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'name');
         if ($ufGroupName) {
             $templateFile = "CRM/Profile/Page/{$ufGroupName}/Listings.tpl";
             if ($template->template_exists($templateFile)) {
                 return $templateFile;
             }
         }
     }
     return parent::getTemplateFileName();
 }
Exemplo n.º 5
0
 function getTemplateFileName()
 {
     if ($this->_contactId) {
         $csType = $this->get('contactSubtype');
         if ($csType) {
             $templateFile = "CRM/Contact/Page/View/SubType/{$csType}.tpl";
             $template = CRM_Core_Page::getTemplate();
             if ($template->template_exists($templateFile)) {
                 return $templateFile;
             }
         }
     }
     return parent::getTemplateFileName();
 }
Exemplo n.º 6
0
 /**
  * @return string
  */
 public function getTemplateFileName()
 {
     if ($this->_contactId) {
         $contactSubtypes = $this->get('contactSubtype') ? explode(CRM_Core_DAO::VALUE_SEPARATOR, $this->get('contactSubtype')) : array();
         // there could be multiple subtypes. We check templates for each of the subtype, and return the first one found.
         foreach ($contactSubtypes as $csType) {
             if ($csType) {
                 $templateFile = "CRM/Contact/Page/View/SubType/{$csType}.tpl";
                 $template = CRM_Core_Page::getTemplate();
                 if ($template->template_exists($templateFile)) {
                     return $templateFile;
                 }
             }
         }
     }
     return parent::getTemplateFileName();
 }