english/administrator/components/com_aicontactsafe/models/control_panel.php
// function to check if the message section in the template is activated
function to check if the message section in the template is activated
function to check if the message section in the template is activated
function checkMessageSection() {
		$db = & JFactory::getDBO();
		$query = 'SELECT template FROM `#__templates_menu` where client_id = 0 and ( menuid = 0 or menuid in ( select id from `#__menu` where link like \'%option=com_aicontactsafe%\' ) )';
		$db->setQuery( $query );
		$templates = $db->loadResultArray();
		jimport('joomla.filesystem.file');
		$rspTemplates = array();
		foreach($templates as $template) {
			$indexFile = JPATH_ROOT.DS.'templates'.DS.$template.DS.'index.php';
			$fileTemplate = JFile::read($indexFile);
			$cntMessageSection = substr_count($fileTemplate, '<jdoc:include type="message" />');
			if ( $cntMessageSection == 0 ) {
				$rspTemplates[] = $template;
			}
		}
		return $rspTemplates;
	}
function checkMessageSection ( ) { $ db = & JFactory :: getDBO ( ) ; $ query = 'SELECT template FROM `#__templates_menu` where client_id = 0 and ( menuid = 0 or menuid in ( select id from `#__menu` where link like \'%option=com_aicontactsafe%\' ) )' ; $ db -> setQuery ( $ query ) ; $ templates = $ db -> loadResultArray ( ) ; jimport ( 'joomla.filesystem.file' ) ; $ rspTemplates = array ( ) ; foreach ( $ templates as $ template ) { $ indexFile = JPATH_ROOT . DS . 'templates' . DS . $ template . DS . 'index.php' ; $ fileTemplate = JFile :: read ( $ indexFile ) ; $ cntMessageSection = substr_count ( $ fileTemplate , '<jdoc:include type="message" />' ) ; if ( $ cntMessageSection == 0 ) { $ rspTemplates [ ] = $ template ; } } return $ rspTemplates ; }
function to check if the message section in the template is activated
function to check if the message section in the template is activated
// initialize the database // get all the templates // import joomla clases to manage file system