Example #1
0
 /**
  * Get's the input
  *
  * @return mixed
  */
 protected function getInput()
 {
     $params = JComponentHelper::getParams((string) $this->element['component']);
     $imageSize = explode('x', $params->get('thumbs.original', '2400x1800'));
     $layout = new CompojoomLayoutFile('fileupload.fileupload');
     $maxNumberOfFiles = $params->get('max_number_of_files', 10);
     $html = $layout->render(array('url' => (string) $this->element['url'], 'formControl' => $this->formControl, 'fieldName' => $this->fieldname, 'maxNumberOfFiles' => $maxNumberOfFiles, 'fileTypes' => $params->get('image_extensions'), 'maxSize' => $params->get('upload_maxsize'), 'component' => (string) $this->element['component'], 'imageSize' => array('x' => $imageSize[0], 'y' => $imageSize[1])));
     return $html;
 }
Example #2
0
File: cmc.php Project: fracting/cmc
 /**
  * Manupulates the registration form
  *
  * @param   string  &$data  - registration form data
  *
  * @return mixed
  */
 public function onUserRegisterFormDisplay(&$data)
 {
     // Load the funky stuff
     CompojoomHtmlBehavior::jquery();
     JHtml::stylesheet('media/plg_community_cmc/css/style.css');
     JHtml::script('media/plg_community_cmc/js/cmc.js');
     // Create the xml for JForm
     $builder = CmcHelperXmlbuilder::getInstance($this->params);
     $xml = $builder->build();
     $form = new JForm('myform');
     $form->addFieldPath(JPATH_ADMINISTRATOR . '/components/com_cmc/models/fields');
     $form->load($xml);
     $displayData = new stdClass();
     $displayData->form = $form;
     $layout = new CompojoomLayoutFile('newsletter.form', JPATH_BASE . '/plugins/community/cmc/layouts');
     $html = $layout->render($displayData);
     $pos = strrpos($data, '<div class="joms-form__group">');
     $data = substr($data, 0, $pos) . $html . substr($data, $pos);
 }
Example #3
0
 /**
  * Checks if the user has reviewed the component & if he hasn't, it asks him to review
  *
  * @throws Exception
  *
  * @return void
  */
 public function reviewed()
 {
     $config = JComponentHelper::getParams($this->component);
     $jed = $config->get('jed', 0);
     $result = '';
     if ($jed != 1) {
         $layout = new CompojoomLayoutFile('jed.jed');
         if ($jed == 0) {
             $result = $layout->render($this->data);
         } else {
             $now = JFactory::getDate();
             $reminderSet = JFactory::getDate($jed);
             $diff = $now->diff($reminderSet);
             if ($diff->days > 7) {
                 $result = $layout->render($this->data);
             }
         }
     }
     echo '###' . $result . '###';
     // Cut the execution short
     JFactory::getApplication()->close();
 }
Example #4
0
<?php

/**
 * @package    Lib_Compojoom
 * @author     DanielDimitrov <*****@*****.**>
 * @date       10.06.2015
 *
 * @copyright  Copyright (C) 2008 - 2015 compojoom.com . All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die('Restricted access');
$fb = new CompojoomLayoutFile('social.share.facebook');
$twitter = new CompojoomLayoutFile('social.share.twitter');
$gplus = new CompojoomLayoutFile('social.share.gplus');
echo $fb->render($displayData);
echo $twitter->render($displayData);
echo $gplus->render($displayData);