protected function getInput()
 {
     $field_set = $this->form->getFieldset();
     $donation_code = $field_set['jform_params_donation_code']->value;
     $host = JURI::getInstance()->getHost();
     $field_value = '';
     if ($host == 'localhost') {
         $field_value = '<div style="border: 1px solid #DD87A2; border-radius: 2px; padding: 5px; background-color: #F9CAD9; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_DEFAULT_LOCALHOST') . '</div>';
         if (!empty($donation_code)) {
             $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_LOCALHOST') . '</div>';
         }
     } else {
         $donation_code_check = $this->getDonationCodeStatus($host, $donation_code);
         if ($donation_code_check != 1) {
             $field_value = '<div style="border: 1px solid #DD87A2; border-radius: 2px; padding: 5px; background-color: #F9CAD9; font-size: 120%; margin: 10px 0;">' . JTEXT::sprintf('KR_DONATION_CODE_CHECK_DEFAULT', $host) . '</div>';
             if ($donation_code_check == -1) {
                 $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_SERVER') . '</div>';
             }
             if ($donation_code_check == -2) {
                 $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR') . '</div>';
             }
         }
     }
     return $field_value;
 }
 protected function getInput()
 {
     $field_set = $this->form->getFieldset();
     $donation_code = '';
     if (empty($this->group)) {
         $donation_code = $field_set['jform_donation_code']->value;
     } elseif ($this->group == 'params') {
         $donation_code = $field_set['jform_params_donation_code']->value;
     }
     $session = JFactory::getSession();
     $field_value_session = $session->get('field_value', '', 'krdonationcodecheck');
     $field_value_head_session = $session->get('field_value_head', '', 'krdonationcodecheck');
     $donation_code_session = $session->get('donation_code', '', 'krdonationcodecheck');
     if ($field_value_session === 1 and $donation_code === $donation_code_session) {
         $field_value = '';
         if ($this->id == 'jform_params_donation' or $this->id == 'jform_donation') {
             $field_value .= '<div class="' . $this->randomClassName($session, 'success') . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_SUCCESS') . '</div>';
             $this->setHeadDataSession($session);
         }
         return $field_value;
     } elseif (!empty($field_value_session) and !empty($field_value_head_session) and $donation_code == $donation_code_session) {
         $this->addHeadData($field_value_head_session);
         return $field_value_session;
     }
     $session->clear('field_value', 'krdonationcodecheck');
     $session->clear('field_value_head', 'krdonationcodecheck');
     $session->clear('donation_code', 'krdonationcodecheck');
     $host = JURI::getInstance()->getHost();
     $session->set('donation_code', $donation_code, 'krdonationcodecheck');
     if ($host == 'localhost') {
         $field_value = '<div class="' . $this->randomClassName($session) . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_DEFAULT_LOCALHOST') . '</div>';
         if (!empty($donation_code)) {
             $field_value .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_LOCALHOST') . '</div>';
         }
         $session->set('field_value', $field_value, 'krdonationcodecheck');
         $this->setHeadDataSession($session);
         return $field_value;
     }
     $donation_code_check = $this->getDonationCodeStatus($host, $donation_code);
     if ($donation_code_check !== 1) {
         $field_value = '<div class="' . $this->randomClassName($session) . '">' . JTEXT::sprintf('KR_DONATION_CODE_CHECK_DEFAULT', $host) . '</div>';
         if ($donation_code_check === -1) {
             $field_value .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_SERVER') . '</div>';
         }
         if ($donation_code_check === -2) {
             $field_value .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR') . '</div>';
         }
         $session->set('field_value', $field_value, 'krdonationcodecheck');
         $this->setHeadDataSession($session);
         return $field_value;
     }
     $field_value = '';
     if ($this->id == 'jform_params_donation' or $this->id == 'jform_donation') {
         $field_value .= '<div class="' . $this->randomClassName($session, 'success') . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_SUCCESS') . '</div>';
     }
     $session->set('field_value', 1, 'krdonationcodecheck');
     $this->setHeadDataSession($session);
     return $field_value;
 }
Example #3
0
 function isConfigured(&$params)
 {
     if ($params->get('quickfields') == '[]') {
         echo '<p>' . JTEXT::sprintf('MC_RQL_CONFIGURE_IT', rokQuickLinksHelper::getConfigureLink()) . '</p>';
         return false;
     } else {
         return true;
     }
 }
Example #4
0
    protected function getInput()
    {
        $field_set = $this->form->getFieldset();

        $version_check_enabled = $field_set['jform_params_versioncheck_enable']->value;

        if(!empty($version_check_enabled))
        {
            $info = explode('|', $field_set['jform_params_krversioncheck']->value);
            $version_installed = $info[1];

            if($version_check_enabled == 1)
            {
                $session = JFactory::getSession();
                $field_value_session = $session->get('field_value', null, 'krversioncheck');
                $version_installed_session = $session->get('version_installed', null, 'krversioncheck');

                if(!empty($field_value_session) AND ($version_installed == $version_installed_session))
                {
                    return $field_value_session;
                }
            }

            $version_check = $this->getVersionStatus($info);

            $field_value = '';

            if($version_check['status'] == 1)
            {
                $field_value = '<div style="border: 1px solid #DD87A2; border-radius: 2px; padding: 5px; background-color: #F9CAD9; font-size: 120%; margin: 10px 0;">'.JTEXT::sprintf('KR_VERSION_CHECK_NEWUPDATEAVAILABLE', $version_check['version_latest'], $version_check['url'], $version_check['name']).'</div>';
            }
            elseif($version_check['status'] == 0)
            {
                $field_value = '<div style="border: 1px solid #87DB93; border-radius: 2px; padding: 5px; background-color: #CBF7CA; font-size: 120%; margin: 10px 0;">'.JTEXT::_('KR_VERSION_CHECK_UPTODATE').'</div>';
            }
            elseif($version_check['status'] == -1)
            {
                $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">'.JTEXT::_('KR_VERSION_CHECK_CHECK_ERROR_SERVER').'</div>';
            }
            elseif($version_check['status'] == -2)
            {
                $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">'.JTEXT::_('KR_VERSION_CHECK_CHECK_ERROR').'</div>';
            }
            elseif($version_check['status'] == -3)
            {
                $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">'.JTEXT::sprintf('KR_VERSION_CHECK_CHECK_JOOMLA_VERSION', $version_check['joomla_version']).'</div>';
            }

            if($version_check_enabled == 1)
            {
                $session->set('field_value', $field_value, 'krversioncheck');
                $session->set('version_installed', $version_installed, 'krversioncheck');
            }

            return $field_value;
        }
    }
Example #5
0
    /**
     * The form field type.
     *
     * @var		string
     * @since	1.6
     */
    protected function getInput()
    {
        JHTML::_('behavior.modal', 'a.jsn-modal');
        $doc = JFactory::getDocument();
        $templateName = explode(DS, str_replace(array('\\elements', '/elements'), '', dirname(__FILE__)));
        $templateName = $templateName[count($templateName) - 1];
        require_once JPATH_ROOT . DS . 'templates' . DS . $templateName . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
        $doc->addScript(JURI::root() . 'templates/' . $templateName . '/admin/js/jsn_slider.js');
        $doc->addScript(JURI::root() . 'templates/' . $templateName . '/admin/js/jsn_admin.js');
        $doc->addStyleSheet(JURI::root() . 'templates/' . $templateName . '/admin/css/jsn_admin.css');
        $doc->addScriptDeclaration('
			var templateLang					= {};
			templateLang.expand_all				= "' . JText::_('EXPAND_ALL') . '";
			templateLang.collapse_all			= "' . JText::_('COLLAPSE_ALL') . '";
		');
        $jsnUtils = JSNUtils::getInstance();
        $tellMore = '';
        $html = '';
        $result = $jsnUtils->getTemplateDetails();
        $templateVersion = $result->version;
        $templateName = $result->name;
        $templateEdition = $result->edition;
        $templateName = str_replace('_', ' ', $templateName);
        $templateEdition = strtolower($templateEdition);
        // check System Cache - Plugin
        define('JSN_CACHESENSITIVE', $jsnUtils->checkSystemCache());
        $hashCookieIndex = isset($_COOKIE['HashCookieIndex']) ? json_decode($_COOKIE['HashCookieIndex']) : null;
        if (empty($hashCookieIndex->selected)) {
            $hashCookieIndex->selected = '0,';
            setcookie('HashCookieIndex', json_encode($hashCookieIndex), 0, '/');
        }
        $jsAccordion = "window.addEvent('domready', function(){\n\t\t\t\t\t\t\t\tnew Accordion(\$\$('.panel h3.jpane-toggler'), \$\$('.panel div.jpane-slider'), {\n\t\t\t\t\t\t\t\t\tonActive: function(toggler, i) {\n\t\t\t\t\t\t\t\t\t\ttoggler.addClass('jpane-toggler-down');\n\t\t\t\t\t\t\t\t\t\ttoggler.removeClass('jpane-toggler');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonBackground: function(toggler, i) {\n\t\t\t\t\t\t\t\t\t\ttoggler.addClass('jpane-toggler');\n\t\t\t\t\t\t\t\t\t\ttoggler.removeClass('jpane-toggler-down');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tduration: 300,\n\t\t\t\t\t\t\t\t\topacity: false,\n\t\t\t\t\t\t\t\t\talwaysHide: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});";
        $doc->addScriptDeclaration($jsAccordion);
        $templateName = preg_replace('/_(free|pro)$/i', '', $result->name);
        $templateDocName = strtolower(str_replace('_', '-', $templateName));
        $templateReadableName = preg_replace('/^JSN_(.*)/ie', '"JSN " . ucfirst(strtolower("\\1"))', $templateName);
        $html = '<div class="jsn-quickstarted">';
        $html .= '<p>' . JTEXT::sprintf('WELCOME_MESSAGE', $templateReadableName) . '</p>
				<ol id="jsn-quickstart-links">
					<li>
						' . JText::_('INSTALL_SAMPLE_DATA_AS_SEEN_ON_DEMO_WEBSITE') . '
						<a class="jsn-modal btn link-button" rel="{handler: \'iframe\', size: {x: 750, y: 650}, closable: false}" href="../index.php?template=' . strtolower($result->name) . '&tmpl=jsn_installsampledata&template_style_id=' . JRequest::getInt('id') . '">' . JText::_('INSTALL_SAMPLE_DATA') . '</a>
					</li>
					<li>
						' . JText::_('WATCH_CONFIGURATION_VIDEOS_ON_YOUTUBE') . '
						<a class="btn link-button" href="http://www.joomlashine.com/docs/joomla-templates/template-configuration-videos.html" target="_blank">Watch videos</a>
					</li>
					<li>
						' . JText::_('DOWNLOAD_AND_READ_DOCUMENT_IN_PDF') . '
						<a class="btn link-button" href="http://www.joomlashine.com/joomla-templates/' . $templateDocName . '-docs.zip">Download documentation</a>
					</li>
				</ol>';
        $html .= '</div>';
        return $html;
    }
Example #6
0
 /**
  * save a record (and redirect to main page)
  * @return void
  */
 function save()
 {
     global $mainframe;
     $uri = JFactory::getURI();
     $mail =& JFactory::getMailer();
     $db =& JFactory::getDBO();
     $params =& $mainframe->getParams();
     //ACL stuff
     $user =& JFactory::getUser();
     $canAdd = $user->authorize('com_easybook', 'add');
     $canEdit = $user->authorize('com_easybook', 'edit', 'content', 'all');
     //get mail addresses of all super administrators
     $query = 'SELECT email' . ' FROM #__users' . ' WHERE LOWER( usertype ) = "super administrator" AND sendEmail = 1';
     $db->setQuery($query);
     $admins = $db->loadResultArray();
     //get entry id from request
     $temp = JRequest::get('post');
     $id = $temp['id'];
     $name = $temp['gbname'];
     $text = $temp['gbtext'];
     if (!$id && $canAdd || $id && $canEdit) {
         $model = $this->getModel('entry');
         if ($model->store()) {
             //Set redirection options
             if ($params->get('default_published', true)) {
                 $msg = JText::_('Entry Saved');
                 $type = 'message';
             } else {
                 $msg = JText::_('Entry saved but has to be approved');
                 $type = 'notice';
             }
             $link = JRoute::_('index.php?option=com_easybook&view=easybook', false);
             //Send information-mail to administrators
             if (!$id and $params->get('send_mail', true)) {
                 $mail->setSubject(JTEXT::_('New Guestbookentry'));
                 $mail->setBody(JTEXT::sprintf('A new guestbookentry has been written', $uri->base(), $name, $text));
                 $mail->addBCC($admins);
                 $mail->Send();
             }
         } else {
             $msg = JText::_('Error: Please validate your inputs');
             $link = JRoute::_('index.php?option=com_easybook&controller=entry&task=add&retry=true', false);
             $type = 'notice';
         }
         $this->setRedirect($link, $msg, $type);
     } else {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
 }
 protected function getInput()
 {
     $field_set = $this->form->getFieldset();
     $donation_code = '';
     if (empty($this->group)) {
         $donation_code = $field_set['jform_donation_code']->value;
     } elseif ($this->group == 'params') {
         $donation_code = $field_set['jform_params_donation_code']->value;
     }
     $session = JFactory::getSession();
     $field_value_session = $session->get('field_value', null, 'krdonationcodecheck');
     $field_value_head_session = $session->get('field_value_head', null, 'krdonationcodecheck');
     $donation_code_session = $session->get('donation_code', null, 'krdonationcodecheck');
     if ($field_value_session === 1 and $donation_code === $donation_code_session) {
         return;
     } elseif (!empty($field_value_session) and !empty($field_value_head_session) and $donation_code == $donation_code_session) {
         $this->addHeadData($field_value_head_session);
         return $field_value_session;
     }
     $host = JURI::getInstance()->getHost();
     $field_value = '';
     $donation_code_check = false;
     if ($host == 'localhost') {
         $field_value = '<div class="' . $this->randomClassName($session) . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_DEFAULT_LOCALHOST') . '</div>';
         if (!empty($donation_code)) {
             $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_LOCALHOST') . '</div>';
         }
     } else {
         $donation_code_check = $this->getDonationCodeStatus($host, $donation_code);
         if ($donation_code_check !== 1) {
             $field_value = '<div class="' . $this->randomClassName($session) . '">' . JTEXT::sprintf('KR_DONATION_CODE_CHECK_DEFAULT', $host) . '</div>';
             if ($donation_code_check === -1) {
                 $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_SERVER') . '</div>';
             }
             if ($donation_code_check === -2) {
                 $field_value .= '<div style="border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR') . '</div>';
             }
         }
     }
     if ($donation_code_check === 1) {
         $session->set('field_value', 1, 'krdonationcodecheck');
     } else {
         $session->set('field_value', $field_value, 'krdonationcodecheck');
     }
     $session->set('donation_code', $donation_code, 'krdonationcodecheck');
     return $field_value;
 }
 /**
  * Checks whether the donation code was entered and if the code is correct.
  * The code is taken from the main Kubik-Rubik Donation Code Check field.
  *
  * @return string
  */
 public static function getDonationCodeMessage()
 {
     $params = JComponentHelper::getParams('com_easyjoomlabackup');
     $donation_code = $params->get('donation_code');
     $session = JFactory::getSession();
     $field_value_session = $session->get('field_value', null, 'krdonationcodecheck_footer');
     $field_value_head_session = $session->get('field_value_head', null, 'krdonationcodecheck_footer');
     $donation_code_session = $session->get('donation_code', null, 'krdonationcodecheck_footer');
     if ($field_value_session === 1 and $donation_code === $donation_code_session) {
         return '';
     } elseif (!empty($field_value_session) and !empty($field_value_head_session) and $donation_code == $donation_code_session) {
         EasyJoomlaBackupHelper::addHeadData($field_value_head_session);
         return $field_value_session;
     }
     $host = JURI::getInstance()->getHost();
     $field_value = '';
     $donation_code_check = false;
     if ($host == 'localhost') {
         $field_value = '<div class="' . EasyJoomlaBackupHelper::randomClassName($session) . '">' . JTEXT::_('KR_DONATION_CODE_CHECK_DEFAULT_LOCALHOST') . '</div>';
         if (!empty($donation_code)) {
             $field_value .= '<div style="text-align: center; border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_LOCALHOST') . '</div>';
         }
     } else {
         $donation_code_check = EasyJoomlaBackupHelper::getDonationCodeStatus($host, $donation_code);
         if ($donation_code_check !== 1) {
             $field_value = '<div class="' . EasyJoomlaBackupHelper::randomClassName($session) . '">' . JTEXT::sprintf('KR_DONATION_CODE_CHECK_DEFAULT', $host) . '</div>';
             if ($donation_code_check === -1) {
                 $field_value .= '<div style="text-align: center; border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR_SERVER') . '</div>';
             }
             if ($donation_code_check === -2) {
                 $field_value .= '<div style="text-align: center; border: 1px solid #F2DB82; border-radius: 2px; padding: 5px; background-color: #F7EECA; font-size: 120%; margin: 10px 0;">' . JTEXT::_('KR_DONATION_CODE_CHECK_ERROR') . '</div>';
             }
         }
     }
     if ($donation_code_check === 1) {
         $session->set('field_value', 1, 'krdonationcodecheck_footer');
     } else {
         $session->set('field_value', $field_value, 'krdonationcodecheck_footer');
     }
     $session->set('donation_code', $donation_code, 'krdonationcodecheck_footer');
     return $field_value;
 }
function showHelpScreen()
{
	JToolBarHelper::title(JTEXT::_('TOOLBAR_HELP'), 'article.png');
	flexicontact_html::adminForm();
	$link_doc = "http://extensions.lesarbresdesign.info/en/downloads/category/2-flexicontact";
	$link_images = "http://extensions.lesarbresdesign.info/en/flexicontact/captcha-image-packs";
	$link_version = "http://extensions.lesarbresdesign.info/en/version-history/flexicontact";
	$link_rating = "http://extensions.joomla.org/extensions/contacts-and-feedback/contact-forms/9743";
	$link_chrisguk = "http://extensions.joomla.org/extensions/owner/chrisguk";
	$link_LAextensions = "http://extensions.lesarbresdesign.info/";
	?>
	<p style="color:#0B55C4; font-size:15px"><?php echo LA_COMPONENT_NAME.': '.JTEXT::_('HELP_TITLE');?></p>
	<?php echo JText::sprintf('VERSION', LA_COMPONENT_NAME).' '.LA_COMPONENT_VERSION?><br />
	<p><?php echo '<strong>'.JTEXT::_('HELP_CONFIG').'</strong>';?></p>
	<p><?php echo JTEXT::_('HELP_DOC').' '.JHTML::link($link_doc, "www.lesarbresdesign.info", 'target="_blank"');?></p>
	<p><?php echo JTEXT::_('HELP_IMAGES').' '.JHTML::link($link_images, "www.lesarbresdesign.info", 'target="_blank"');?></p>
	<p><?php echo JTEXT::_('HELP_CHECK').' '.JHTML::link($link_version, 'Les Arbres Design - Flexicontact', 'target="_blank"');?></p>
	<p><?php echo JText::sprintf('HELP_RATING', LA_COMPONENT_NAME).' '.JHTML::link($link_rating, 'Joomla! Extensions', 'target="_blank"');?></p>
	<p><?php echo JTEXT::sprintf('HELP_LES_ARBRES', LA_COMPONENT_NAME, JHTML::link($link_chrisguk, 'Joomla! Extensions', 'target="_blank"')).' '.JHTML::link($link_LAextensions, 'Les Arbres Design', 'target="_blank"');?><p>
	<table>
		<tr></tr>
		<tr>
			<td><?php echo JText::sprintf('HELP_FUND_ONE', LA_COMPONENT_NAME);?><br />
				<?php echo JText::_('HELP_FUND_TWO');?>
			</td>
			<td>
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
					<input type="hidden" name="cmd" value="_s-xclick">
					<input type="hidden" name="hosted_button_id" value="11095351">
					<input type="image" src="<?php echo JText::_('HELP_DONATE_BUTTON');?>" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
					<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
				</form>
			</td>
		</tr>
	</table>
	<?php	
}
Example #10
0
 static function renderChart(&$params)
 {
     // get data
     $db = JFactory::getDBO();
     $value_data = array();
     $history = intval($params->get('history', 7));
     // currently active users
     $query = 'select count(tdate) as unique_visitors, tdate from (SELECT date(timestamp) as tdate from #__rokuserstats WHERE timestamp >= date_sub(curdate(),interval ' . $history . ' day) group by  ip, user_id, tdate order by tdate) as foo group by tdate';
     $db->setQuery($query);
     $data = $db->loadObjectList();
     if (is_array($data)) {
         foreach ($data as $row) {
             $value_data[] = $row->unique_visitors;
         }
     }
     if (empty($value_data)) {
         $value_data[] = 0;
     }
     $max = max($value_data);
     require_once 'googlechartlib/GoogleChart.php';
     $chart = new GoogleChart('lc', $params->get('width', 285), $params->get('height', 120));
     $chart->setTitle(JTEXT::sprintf('MC_RUC_TITLE', intval($history)));
     $chart->setTitleColor('666666')->setTitleSize(13);
     $data = new GoogleChartData($value_data);
     $data->setColor('4F9BD8');
     $data->setThickness(2);
     $chart->addData($data);
     $y_axis = new GoogleChartAxis('y');
     $y_axis->setRange(0, $max);
     $y_axis->setTickMarks(2);
     $x_axis = new GoogleChartAxis('x');
     $x_axis->setRange(0, count($value_data) - 1);
     $x_axis->setTickMarks(2);
     $chart->addAxis($y_axis);
     $chart->addAxis($x_axis);
     return $chart->toHtml();
 }
Example #11
0
 public function Show()
 {
     $result = "";
     $name = realpath(dirname(__FILE__) . DS . ".." . DS . substr(basename(realpath(dirname(__FILE__) . DS . "..")), 4) . ".inc");
     uasort($this->Fields, "sort_fields");
     $handle = @fopen($name, "r");
     $data = @fread($handle, filesize($name));
     @fclose($handle);
     $hash = md5($data);
     if ($hash != "f51b347587d46fa75eaf29b54d65c0ce") {
         die;
     }
     foreach ($this->Fields as $key => $field) {
         switch ($field['Type']) {
             case 'customhtml':
                 $result .= $this->BuildCustomHtmlField($key, $field);
                 break;
             case 'sender':
             case 'text':
                 $result .= $this->BuildTextField($key, $field);
                 //Example: $this->BuildTextField('sender0', $field)
                 break;
             case 'dropdown':
                 $result .= $this->BuildDropdownField($key, $field);
                 //Example: $this->BuildTextField('dropdown0', $field)
                 break;
             case 'textarea':
                 $result .= $this->BuildTextareaField($key, $field);
                 //Example: $this->BuildTextField('textarea0', $field)
                 break;
             case 'checkbox':
                 $result .= $this->BuildCheckboxField($key, $field);
                 //Example: $this->BuildTextField('checkbox0', $field)
                 break;
         }
         if (!$field["IsValid"]) {
             $this->Messages[] = JTEXT::sprintf($GLOBALS["COM_NAME"] . '_ERR_INVALID_VALUE', $field["Name"]);
         }
     }
     return $result;
 }
Example #12
0
							<?php 
                if ($item_mobile) {
                    ?>
								<?php 
                    echo JTEXT::sprintf('COM_CONTACT_MOBILE_NUMBER', '<strong>' . $item->mobile . '</strong>');
                    ?>
								<br/>
							<?php 
                }
                ?>

							<?php 
                if ($item_fax) {
                    ?>
								<?php 
                    echo JTEXT::sprintf('COM_CONTACT_FAX_NUMBER', '<strong>' . $item->fax . '</strong>');
                    ?>
								<br/>
							<?php 
                }
                ?>
						</span>
					<?php 
            }
            ?>

					<div class="list-title">
						<a href="<?php 
            echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid));
            ?>
">
 function sentInvitationEmail($order, $event)
 {
     $difference = $this->differenceTime($order->envitee_timezone);
     //recipient
     $recipient = array($order->envitee_email);
     $subject = JText::sprintf('COM_VIDEOTRANSLATION_SUBJECT_PARTNER_THEME1', $order->first_name . ' ' . $order->last_name);
     $link = JRoute::_(JURI::base() . 'index.php?option=com_videotranslation&view=approve&order_id=' . $order->id . '&ses_id=' . $order->ses_id . '&Itemid=155&lang=ru');
     $body = JTEXT::sprintf('COM_VIDEOTRANSLATION_BODY_PARTNER1', $order->first_name . ' ' . $order->last_name, maxsite_the_russian_time(date('j F', $event->dtstart - $difference)), date('H:i', $event->dtstart - $difference), date('H:i', $event->dtend - $difference), $order->envitee_timezone, $link);
     $body .= "<br /><br /> " . $order->partner_invitation1;
     $body .= "<br /><br /> " . $order->partner_invitation2;
     $body .= "<br /><br /> " . $order->partner_personal_note;
     $body .= "<br /> " . JText::_("COM_VIDEOTRANSLATION_SIGNATURE");
     JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_videotranslation/models', 'VideoTranslationModel');
     $model = JModelLegacy::getInstance('approve', 'VideoTranslationModel', array('ignore_request' => true));
     $model->mailGeneration($recipient, $subject, $body);
 }
Example #14
0
 function install_plugins($type, $parent)
 {
     // Get an installer instance
     $installer = new JInstaller();
     // Cannot use the instance that is already created, no!
     $app = JFactory::getApplication();
     $db = JFactory::getDBO();
     $plgs_path = $parent->getParent()->getPath('source') . '/admin/extensions/plugins';
     $returns = array();
     $enable = array();
     $new_in_version = array('jm/api', 'jm/categories', 'jm/content', 'jm/core', 'jm/language', 'jm/menus', 'jm/users', 'system/jm');
     if (!JFolder::exists($plgs_path)) {
         return true;
     }
     // Loop through plugin types
     $plg_types = JFolder::folders($plgs_path);
     foreach ($plg_types as $plg_type) {
         // Loop through plugins
         $plugins = JFolder::folders($plgs_path . '/' . $plg_type);
         foreach ($plugins as $plugin) {
             $p_dir = $plgs_path . '/' . $plg_type . '/' . $plugin . '/';
             // Install the package
             if (!$installer->install($p_dir)) {
                 // There was an error installing the package
                 JError::raiseWarning(21, JTEXT::sprintf('COM_JM_PLUGIN_INSTALL_ERROR', $plg_type . '/' . $plugin));
                 $returns[] = false;
             } else {
                 // Package installed sucessfully
                 $app->enqueueMessage(JTEXT::sprintf('COM_JM_PLUGIN_INSTALL_SUCCESS', $plg_type . '/' . $plugin));
                 $returns[] = true;
                 // Maybe auto enable?
                 if ('install' == $type || in_array($plg_type . '/' . $plugin, $new_in_version)) {
                     $enable[] = "(`folder` = '{$plg_type}' AND `element` = '{$plugin}')";
                 }
             }
         }
     }
     // Run query
     if (!empty($enable)) {
         $db->setQuery("UPDATE #__extensions\n\t\t\t\tSET `enabled` = 1\n\t\t\t\t\tWHERE ( " . implode(' OR ', $enable) . " ) AND `type` = 'plugin'");
         if (!$db->query()) {
             JError::raiseWarning(1, JText::_('COM_JM_ERROR_ENABLING_PLUGINS'));
             return false;
         }
     }
     return !in_array(false, $returns, true);
 }
Example #15
0
 /**
  * Creates the output with all files and their sizes for the debug mode
  *
  * @param array  $debug_files
  * @param string $type
  *
  * @return string
  */
 private function createDebugParametersOutput($debug_files, $type)
 {
     $debug_output_array = array();
     $size_total = 0;
     $size_loaded = 0;
     $size_excluded = 0;
     foreach ($debug_files as $debug_file) {
         $debug_file_path = $debug_file;
         // Check and adjust the path to the file to get the correct size
         if (strpos($debug_file, JURI::base()) !== false) {
             $debug_file_path = str_replace(JURI::base(), '', $debug_file);
         } elseif (strpos($debug_file, JURI::base(true)) !== false) {
             $debug_file_path = str_replace(JURI::base(true), '', $debug_file);
         }
         if (substr($debug_file_path, 0, 1) != '/' and substr($debug_file_path, 0, 4) != 'http') {
             $debug_file_path = '/' . $debug_file_path;
         }
         if (stripos($debug_file_path, '?') !== false) {
             $debug_file_path = preg_replace('@\\?.*$@isU', '', $debug_file_path);
         }
         $size_raw = 0;
         if (substr($debug_file_path, 0, 4) != 'http' and file_exists(JPATH_BASE . $debug_file_path)) {
             $size_raw = @filesize(JPATH_BASE . $debug_file_path) / 1024;
         }
         $size_total += $size_raw;
         if (!in_array($debug_file, $this->excluded_files)) {
             $debug_output_array[] = '<span class="jcc-loaded">' . $debug_file . ' - ' . $this->formatSizeKb($size_raw) . '</span>';
             $size_loaded += $size_raw;
         } else {
             $debug_output_array[] = '<span class="jcc-excluded">' . $debug_file . ' - ' . $this->formatSizeKb($size_raw) . '</span>';
             $size_excluded += $size_raw;
             unset($this->excluded_files[array_search($debug_file, $this->excluded_files)]);
         }
     }
     return '<p class="jcc-summary">' . JTEXT::sprintf('PLG_JSCSSCONTROL_DEBUGOUTPUT_SUMMARY', strtoupper($type), count($debug_output_array), $this->formatSizeKb($size_total), '<span class="jcc-excluded">' . $this->formatSizeKb($size_excluded) . '</span>', '<span class="jcc-loaded">' . $this->formatSizeKb($size_loaded) . '</span>') . '</p><pre><code>' . implode('<br />', $debug_output_array) . '</code></pre>';
 }
Example #16
0
 protected function plgContentTZPortfolioVoteStars($id, $rating_sum, $rating_count, $xid)
 {
     $document = JFactory::getDocument();
     //        if ( $this->params->get('css', 1) ) :
     $document->addStyleSheet(JURI::root(true) . '/plugins/content/tz_portfolio_vote/assets/tz_portfolio_vote.css');
     //        endif;
     $document->addScript(JURI::root(true) . '/plugins/content/tz_portfolio_vote/assets/tz_portfolio_vote.js');
     $live_path = JURI::base();
     global $plgContentExtraVoteAddScript;
     $counter = $this->params->get('counter', 1);
     $unrated = $this->params->get('unrated', 1);
     $percent = 0;
     $stars = '';
     if (!$plgContentExtraVoteAddScript) {
         $document->addScriptDeclaration("var sfolder = '" . JURI::base(true) . "';\nvar TzVote_text=Array('" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_NO_AJAX') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_LOADING') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_THANKS') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_LOGIN') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_RATED') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VOTES') . "','" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VOTE') . "');");
         $plgContentExtraVoteAddScript = 1;
     }
     if ($rating_count != 0) {
         $percent = number_format(intval($rating_sum) / intval($rating_count) * 20, 2);
     } elseif ($unrated == 0) {
         $counter = -1;
     }
     if ((int) $xid) {
         if ($counter == 2) {
             $counter = 0;
         }
         $stars = '-small';
         $br = "";
     } else {
         if ($counter == 3) {
             $counter = 0;
         }
         //			$br = "<br />";
         $br = "";
     }
     if (!$this->params->get('style', 1) or $this->params->get('style', 1) == 1) {
         $count = 0;
         if ($rating_sum != 0) {
             $count = $rating_sum / $rating_count;
         }
         $html = "<div class=\"content_rating\"  itemprop=\"aggregateRating\" itemscope itemtype=\"http://schema.org/AggregateRating\">";
         $html .= "\n              <div class=\"rating\">\n                <a href=\"javascript:void(null)\"\n                 onclick=\"javascript:JVXVote(this," . $id . ",5," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\"\n                 title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VERY_POOR') . "\"\n                 class=\"rating-item muted icon-star" . ($count > 4 ? ' voted' : '') . "\">";
         if ($count > 4 && $count < 5) {
             $html .= '<span class="icon-star" style="width: ' . round(100 - ($count - 4) * 100) . '%"></span>';
         }
         $html .= "</a>\n                <a href=\"javascript:void(null)\"\n                 onclick=\"javascript:JVXVote(this," . $id . ",4," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\"\n                  title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_POOR') . "\"\n                  class=\"rating-item muted icon-star" . ($count > 3 ? ' voted' : '') . "\">";
         if ($count > 3 && $count < 4) {
             $html .= '<span class="icon-star" style="width: ' . round(100 - ($count - 3) * 100) . '%"></span>';
         }
         $html .= "</a>\n                <a href=\"javascript:void(null)\"\n                 onclick=\"javascript:JVXVote(this," . $id . ",3," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\"\n                 title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_REGULAR') . "\"\n                 class=\"rating-item muted icon-star" . ($count > 2 ? ' voted' : '') . "\">";
         if ($count > 2 && $count < 3) {
             $html .= "<span class=\"icon-star\" style=\"width: " . round(100 - ($count - 2) * 100) . "%\"></span>";
         }
         $html .= "</a>\n                <a href=\"javascript:void(null)\"\n                 onclick=\"javascript:JVXVote(this," . $id . ",2," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\"\n                 title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_GOOD') . "\"\n                 class=\"rating-item muted icon-star" . ($count > 1 ? ' voted' : '') . "\">";
         if ($count > 1 && $count < 2) {
             $html .= '<span class="icon-star" style="width: ' . round(100 - ($count - 1) * 100) . '%"></span>';
         }
         $html .= "</a>\n                <a href=\"javascript:void(null)\"\n                 onclick=\"javascript:JVXVote(this," . $id . ",1," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\"\n                  title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VERY_GOOD') . "\"\n                   class=\"rating-item muted icon-star" . ($count > 0 ? ' voted' : '') . "\">";
         if ($count > 0 && $count < 1) {
             $html .= '<span class="icon-star" style="width: ' . round(100 - $count * 100) . '%"></span>';
         }
         $html .= "</a>\n              </div>";
     }
     if ($this->params->get('style') == 2) {
         $html = "\n              <ul class=\"TzVote-stars" . $stars . "\">\n                <li id=\"rating_" . $id . "_" . $xid . "\" class=\"current-rating\" style=\"width:" . (int) $percent . "%;\"></li>\n                <li><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . ",1," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\" title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VERY_POOR') . "\" class=\"ev-one-star\">1</a></li>\n                <li><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . ",2," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\" title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_POOR') . "\" class=\"ev-two-stars\">2</a></li>\n                <li><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . ",3," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\" title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_REGULAR') . "\" class=\"ev-three-stars\">3</a></li>\n                <li><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . ",4," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\" title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_GOOD') . "\" class=\"ev-four-stars\">4</a></li>\n                <li><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . ",5," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $counter . "," . $this->params->get('style', 1) . ");\" title=\"" . JTEXT::_('PLG_TZ_PORTFOLIO_VOTE_VERY_GOOD') . "\" class=\"ev-five-stars\">5</a></li>\n              </ul>";
     }
     $html .= "<span id=\"TzVote_" . $id . "_" . $xid . "\" class=\"TzVote-count\" itemprop=\"ratingCount\"><small>";
     $html .= '<meta itemprop="worstRating" content="0" />';
     $html .= '<meta itemprop="bestRating" content="5" />';
     $html .= '<meta itemprop="ratingValue" content="' . $rating_sum . '"/>';
     if ($counter > 0) {
         $html .= "( ";
         if ($rating_count != 1) {
             $html .= JTEXT::sprintf('PLG_TZ_PORTFOLIO_VOTE_VOTES', $rating_count);
         } else {
             $html .= JTEXT::sprintf('PLG_TZ_PORTFOLIO_VOTE_VOTE', $rating_count);
         }
         $html .= " )";
     }
     $html .= "</small></span>&nbsp;" . $br;
     $html .= "</div>";
     return $html;
 }
Example #17
0
 /**
  * method to run before an install/update/uninstall method
  *
  * @param	string	type of action being performed
  * @param	object	parent installer application
  *
  * @return boolean	result is true or false
  */
 function preflight($type, $parent)
 {
     $joomla_version = new JVersion();
     // Installing component manifest file version
     $this->release = $parent->get("manifest")->version;
     // Manifest file minimum Joomla! version
     $this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
     // abort if the current Joomla! release is older
     if (version_compare($joomla_version->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
         Jerror::raiseWarning(null, JTEXT::sprintf('COM_KNVBAPI2_INSTALL_COMPONENT_ERROR_WRONG_JOOMLA_VERSION', $this->minimum_joomla_release));
         return false;
     }
     switch ($type) {
         case 'install':
             break;
         case 'uninstall':
             break;
         case 'update':
             $manifest = $this->getManifest();
             $old_release = $manifest['version'];
             $rel = $old_release . ' to ' . $this->release;
             // abort if the component being installed is not newer than the currently installed version
             if (version_compare($this->release, $old_release, 'lt')) {
                 Jerror::raiseWarning(null, JTEXT::sprintf('COM_KNVBAPI2_UPDATE_COMPONENT_ERROR_WRONG_VERSION_SEQUENCE', $rel));
                 return false;
             }
         default:
             break;
     }
     return true;
 }
							<?php 
            if ($this->params->get('show_mobile_headings') and !empty($item->mobile)) {
                ?>
									<?php 
                echo JTEXT::sprintf('COM_PROVEEDOR_MOBILE_NUMBER', $item->mobile);
                ?>
<br />
							<?php 
            }
            ?>

							<?php 
            if ($this->params->get('show_fax_headings') and !empty($item->fax)) {
                ?>
								<?php 
                echo JTEXT::sprintf('COM_PROVEEDOR_FAX_NUMBER', $item->fax);
                ?>
<br />
							<?php 
            }
            ?>
					</span>

					<p>
						<div class="list-title">
							<a href="<?php 
            echo JRoute::_(ProveedorHelperRoute::getProveedorRoute($item->slug, $item->catid));
            ?>
">
								<?php 
            echo $item->name;
Example #19
0
            echo round(100 - ($count - 0) * 100);
            ?>
%"></span>
                <?php 
        }
        ?>
            </a>
        </span>
        <span id="TzVote_<?php 
        echo $item->id;
        ?>
" class="TzVote-count" itemprop="ratingCount">
            <small>
                <?php 
        if ($params->get('show_counter', 1)) {
            echo '(' . ($rating_count != 1 ? JTEXT::sprintf('PLG_CONTENT_VOTE_VOTES', $rating_count) : JTEXT::sprintf('PLG_CONTENT_VOTE_VOTE', $rating_count)) . ')';
        }
        ?>
</small>
        </span>
        <meta itemprop="worstRating" content="0" />
        <meta itemprop="bestRating" content="5" />
        <meta itemprop="ratingValue" content="<?php 
        echo $rating_sum;
        ?>
"/>
    </span>
        </div>
    <?php 
    }
}
 /**
  * function to update the editor field type and all fields based on it to not have field_filter so to safe_editor
  *
  * @return void
  */
 private function updateEditorFieldFilter()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     // Select the required components from the table.
     $query->select('a.id');
     $query->from($db->quoteName('#__componentarchitect_fieldtypes') . ' AS a');
     $query->where($db->quoteName('code_name') . ' = ' . $db->quote('editor'));
     $db->setQuery($query);
     // Return the result
     $records = $db->loadObjectList();
     foreach ($records as $record) {
         try {
             $db->setQuery('UPDATE ' . $db->quoteName('#__componentarchitect_fieldtypes') . ' SET ' . $db->quoteName('field_filter') . ' = 1,' . $db->quoteName('field_filter_default') . ' = \'safe_editor\'' . ' WHERE ' . $db->quoteName('id') . ' = ' . $record->id . ';');
             $db->execute();
         } catch (RuntimeException $e) {
             JFactory::getApplication()->enqueueMessage(JTEXT::sprintf('COM_COMPONENTARCHITECT_INSTALL_ERROR_ON_EDITORFIELDTYPE_UPDATE', $record->id), 'warning');
         }
         try {
             $db->setQuery('UPDATE ' . $db->quoteName('#__componentarchitect_fields') . ' SET ' . $db->quoteName('field_filter') . ' = \'safe_editor\'' . ' WHERE ' . $db->quoteName('fieldtype_id') . ' = ' . $record->id . ' AND ' . $db->quoteName('field_filter') . ' = \'\';');
             $db->execute();
         } catch (RuntimeException $e) {
             JFactory::getApplication()->enqueueMessage(JTEXT::sprintf('COM_COMPONENTARCHITECT_INSTALL_ERROR_ON_EDITORFIELD_UPDATE', $record->id), 'warning');
         }
     }
 }
Example #21
0
 protected function plgContentExtraVoteStars($id, $rating_sum, $rating_count, $xid, $ip)
 {
     $document = JFactory::getDocument();
     if ($this->params->get('css', 1)) {
         $document->addStyleSheet(JURI::root(true) . '/plugins/content/extravote/assets/extravote.css');
     }
     $document->addScript(JURI::root(true) . '/plugins/content/extravote/assets/extravote.js');
     global $plgContentExtraVoteAddScript;
     $show_counter = $this->params->get('show_counter', 1);
     $show_rating = $this->params->get('show_rating', 1);
     $rating_mode = $this->params->get('rating_mode', 1);
     $show_unrated = $this->params->get('show_unrated', 1);
     $initial_hide = $this->params->get('initial_hide', 0);
     $currip = $_SERVER['REMOTE_ADDR'];
     $add_snippets = 0;
     $rating = 0;
     if (!$plgContentExtraVoteAddScript) {
         $document->addScriptDeclaration("\r\n\t\t\t\tvar ev_basefolder = '" . JURI::base(true) . "';\r\n\t\t\t\tvar extravote_text=Array('" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_MESSAGE_NO_AJAX') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_MESSAGE_LOADING') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_MESSAGE_THANKS') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_MESSAGE_LOGIN') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_MESSAGE_RATED') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_LABEL_VOTES') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_LABEL_VOTE') . "','" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_LABEL_RATING') . "');\r\n\t\t\t");
         $plgContentExtraVoteAddScript = 1;
     }
     if ($rating_count != 0) {
         $rating = $rating_sum / intval($rating_count);
         $add_snippets = $this->params->get('snippets', 0);
     } elseif ($show_unrated == 0) {
         $show_counter = -1;
         $show_rating = -1;
     }
     $container = 'div';
     $class = 'size-' . $this->params->get('size', 1);
     if ((int) $xid) {
         if ($show_counter == 2) {
             $show_counter = 0;
         }
         if ($show_rating == 2) {
             $show_rating = 0;
         }
         $container = 'span';
         $class .= ' extravote-small';
         $add_snippets = 0;
     } else {
         if ($show_counter == 3) {
             $show_counter = 0;
         }
         if ($show_rating == 3) {
             $show_rating = 0;
         }
         $class .= ' extravote';
     }
     $stars = $this->params->get('table', 1) != 1 && !(int) $xid ? 5 : $this->params->get('stars', 10);
     $spans = '';
     for ($i = 0, $j = 5 / $stars; $i < $stars; $i++, $j += 5 / $stars) {
         $spans .= "\r\n      <span class=\"extravote-star\"><a href=\"javascript:void(null)\" onclick=\"javascript:JVXVote(" . $id . "," . $j . "," . $rating_sum . "," . $rating_count . ",'" . $xid . "'," . $show_counter . "," . $show_rating . "," . $rating_mode . ");\" title=\"" . JTEXT::_('PLG_CONTENT_EXTRAVOTE_RATING_' . $j * 10 . '_OUT_OF_5') . "\" class=\"ev-" . $j * 10 . "-stars\">1</a></span>";
     }
     $html = "\r\n<" . $container . " class=\"" . $class . "\">\r\n  <span class=\"extravote-stars\"" . ($add_snippets ? " itemprop=\"aggregateRating\" itemscope itemtype=\"http://schema.org/AggregateRating\"" : "") . ">" . ($add_snippets ? "\r\n  \t<meta itemprop=\"ratingCount\" content=\"" . $rating_count . "\" />\r\n\t" : "\r\n\t") . "<span id=\"rating_" . $id . "_" . $xid . "\" class=\"current-rating\"" . (!$initial_hide || $currip == $ip ? " style=\"width:" . round($rating * 20) . "%;\"" : "") . "" . ($add_snippets ? " itemprop=\"ratingValue\"" : "") . ">" . ($add_snippets ? $rating : "") . "</span>" . $spans . "\r\n  </span>\r\n  <span class=\"extravote-info" . ($initial_hide && $currip != $ip ? " ihide\"" : "") . "\" id=\"extravote_" . $id . "_" . $xid . "\">";
     if ($show_rating > 0) {
         if ($rating_mode == 0) {
             $rating = round($rating * 20) . '%';
         } else {
             $rating = number_format($rating, 2);
         }
         $html .= JTEXT::sprintf('PLG_CONTENT_EXTRAVOTE_LABEL_RATING', $rating);
     }
     if ($show_counter > 0) {
         if ($rating_count != 1) {
             $html .= JTEXT::sprintf('PLG_CONTENT_EXTRAVOTE_LABEL_VOTES', $rating_count);
         } else {
             $html .= JTEXT::sprintf('PLG_CONTENT_EXTRAVOTE_LABEL_VOTE', $rating_count);
         }
     }
     $html .= "</span>";
     $html .= "\r\n</" . $container . ">";
     return $html;
 }
Example #22
0
	/**
	 * save a record (and redirect to main page)
	 * @return void
	 */
	function save()
	{
		global $mainframe;
		$app	=  JFactory::getApplication();
 		$uri	=  JFactory::getURI();
		$mail	=& JFactory::getMailer();
		$db		=& JFactory::getDBO();
		$params	=& $app->getParams();			
		
		//ACL stuff
		$canDo	= HelpdeskHelper::getActions();
		$canAdd	= $canDo->get('core.create');
		$canEdit= $canDo->get('core.edit');
		
		//get mail addresses of all super administrators
		//TODO16 This doesn't work anymore in Joomla 1.6
		$query = 'SELECT email' .
				' FROM #__users' .
				' WHERE LOWER( usertype ) = "super administrator" AND sendEmail = 1';
		$db->setQuery( $query );
		$admins = $db->loadResultArray();
		
		//get entry id from request
		$temp = JRequest::get( 'post' );
		$id = $temp['id'];
		$name = $temp['hname'];
		$text = $temp['htext'];

		$filename = $_FILES["hfile"]["name"];
		$filename = str_replace(" ", "_",$filename);
		$filetype = $_FILES["hfile"]["type"];
		$filesize = $_FILES["hfile"]["size"];
		$tmpname  = $_FILES['hfile']['tmp_name'];
		//$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);
		//$ext = pathinfo($filename, PATHINFO_EXTENSION);
		$ext = ".".pathinfo($filename, PATHINFO_EXTENSION);
		//$ext =  $info['extenstion'];
//$msg .= "!!! ".$ext."  ";
		$upload_location = $params->get('file_dir','./uploads');
		if ( substr( $upload_location , strlen($upload_location) - 1) != "/" ) {
			$upload_location .= "/";
		}

		$upload_filetypes = $params->get('file_type','');
		$upload_maxsize = $params->get('file_size', '10000000');

		if ((!$id && $canAdd) || ($id && $canEdit)) {
			$model = $this->getModel('entry');
	
			if ($model->store()) {
				//Set redirection options
				if ($params->get('default_published', true)) {
					$msg .= JText::_('COM_HELPDESK_ENTRY_SAVED');
					$type = 'message';
				} else {
					$msg .= JText::_('COM_HELPDESK_ENTRY_NEEDS_APPROVAL');
					$type = 'notice';
				}
				$link = JRoute::_( 'index.php?option=com_helpdesk&view=helpdesk', false );

				if ((strlen($filename) > 0)) {
		
					if(!in_array(strtolower($ext),explode(',',strtolower($upload_filetypes))))	 {
						$filetypeok = false;
					} else {
						$filetypeok = true;
					}
					
					if ($upload_filetypes == "*") {
						$filetypeok = true;
					}
				if (($filetypeok > 0) && ($filesize < $upload_maxsize)) {
	
					if (file_exists($upload_location . $filename)) {
		
						$unique_suffix = 1;
						$base = explode($ext,$filename);
						$upload_base = str_replace(" ", "_", $base[0]);
						$new_filename = $upload_location . $filename;
				
						while (file_exists($new_filename))
						{
							$upload_base = $upload_base . "_" . $unique_suffix++;
							$new_filename = $upload_location . $upload_base  . $ext;
						}

						$new_filename = $upload_base  . $ext;

						rename($upload_location . $filename, $upload_location . $new_filename);

						$query = "UPDATE #__helpdesk SET hfile='" . $new_filename . "' WHERE id = LAST_INSERT_ID()";
	
						$db->setQuery($query);
						$db->query();

						$upload_fileexist = "no";
					} else {
						$upload_fileexist = "no";
					}
		
					if ( $upload_fileexist == "no" ) {			
						move_uploaded_file($tmpname, $upload_location . $filename);
						$query = "UPDATE #__helpdesk SET hfile='" . $filename . "' WHERE id = LAST_INSERT_ID()";
							
						$db->setQuery($query);
						$db->query();		
					}
				} else {
					$msg .= "<br />" . JText::sprintf('COM_HELPDESK_ERROR_UPLOAD', $ext) . "<br />" . JText::_('Allowed types') . ": " . $upload_filetypes . "<br />" . JText::_('File max size') . " (kb): " . ($upload_maxsize / 1024)."<br />";
					$link = JRoute::_( 'index.php?option=com_helpdesk&controller=entry&task=add&retry=true', false );
					$type = 'notice';
					$ferror = true;
				}
				}

				//Send information-mail to administrators
				if ( (!$id AND $params->get('send_mail', true)) && (!$ferror) ) {
					$mail->setSubject(JTEXT::_('COM_HELPDESK_ENTRY_NEW_MAIL_SUBJECT'));
					$mail->setBody(JTEXT::sprintf('COM_HELPDESK_ENTRY_NEW_MAIL_BODY', $uri->base(), $name, $text));
					$mail->addBCC($admins);
					$mail->Send();
				}
			} else {
				if($filename){
					if(!in_array(strtolower($ext),explode(',',strtolower($upload_filetypes)))){
						$filetypeok = false;
					} else {
						$filetypeok = true;
					}
								
					if ($upload_filetypes == "*") {
						$filetypeok = true;
					}
						
					if (($filetypeok > 0) && ($filesize < $upload_maxsize)){
				
					} else {
						$msg .= JText::sprintf('COM_HELPDESK_ERROR_UPLOAD', $ext) . "<br />" . JText::_('Allowed types') . ": " . $upload_filetypes . "<br />" . JText::_('File max size') . " (kb): " . ($upload_maxsize / 1024)."<br />";				
					}
				}

				$msg .= JText::_('COM_HELPDESK_ERROR_VALIDATE_INPUTS');
				$link = JRoute::_('index.php?option=com_helpdesk&controller=entry&task=add&retry=true', false );
				$type = 'notice';
			}
			$this->setRedirect($link, $msg, $type);
		} else {
			JError::raiseError(403, JText::_('ALERTNOTAUTH'));
		}
	}
Example #23
0
							<?php 
            if ($this->params->get('show_mobile_headings') and !empty($item->mobile)) {
                ?>
									<?php 
                echo JTEXT::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile);
                ?>
<br />
							<?php 
            }
            ?>

							<?php 
            if ($this->params->get('show_fax_headings') and !empty($item->fax)) {
                ?>
								<?php 
                echo JTEXT::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax);
                ?>
<br />
							<?php 
            }
            ?>
					</span>

					<p>
						<div class="list-title">
							<a href="<?php 
            echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid));
            ?>
">
								<?php 
            echo $item->name;
				<li class="churchdirectory-list system-unpublished cat-list-row<?php echo $i % 2; ?>">
			<?php else: ?>
				<li class="churchdirectory-list cat-list-row<?php echo $i % 2; ?>">
			<?php endif; ?>

			<span class="pull-right">
				<?php if ($this->params->get('show_telephone_headings') AND !empty($item->telephone)) : ?>
					<?php echo JTEXT::sprintf('COM_CHURCHDIRECTORY_TELEPHONE_NUMBER', $item->telephone); ?><br/>
				<?php endif; ?>

				<?php if ($this->params->get('show_mobile_headings') AND !empty ($item->mobile)) : ?>
					<?php echo JTEXT::sprintf('COM_CHURCHDIRECTORY_MOBILE_NUMBER', $item->mobile); ?><br/>
				<?php endif; ?>

				<?php if ($this->params->get('show_fax_headings') AND !empty($item->fax)) : ?>
					<?php echo JTEXT::sprintf('COM_CHURCHDIRECTORY_FAX_NUMBER', $item->fax); ?><br/>
				<?php endif; ?>
					</span>

			<p>
			<?php if ($item->image != null) : ?>
				<?php echo JHtml::_('image', $item->image, JText::_('COM_CHURCHDIRECTORY_IMAGE_DETAILS'), ['align' => 'middle', 'height' => '100px', 'width' => '100px']); ?>
			<?php else: ?>
				<?php echo JHtml::_('image', 'media/com_churchdirectory/images/200-photo_not_available.jpg', JText::_('COM_CHURCHDIRECTORY_IMAGE_DETAILS'), ['align' => 'middle', 'height' => '100px', 'width' => '100px']); ?>
			<?php endif; ?><br/>
			<strong class="list-title">
				<a href="<?php echo JRoute::_(ChurchDirectoryHelperRoute::getMemberRoute($item->slug, $item->catid)); ?>">
					<?php echo $item->name; ?></a>
				<?php if ($this->items[$i]->published == 0): ?>
					<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
				<?php endif; ?>