Example #1
0
function view_pictures($id, $uid)
{
    JHtml::_('behavior.framework', true);
    Jhtml::_('behavior.modal');
    $img_path = JURI::base() . "components/com_sauto/assets/users/" . $uid . "/";
    $db = JFactory::getDbo();
    $query = "SELECT * FROM #__sa_poze WHERE `id_anunt` = '" . $id . "' ORDER BY `id` ASC";
    $db->setQuery($query);
    $pics = $db->loadObjectList();
    $height = 0;
    foreach ($pics as $p) {
        $size = getimagesize($img_path . $p->poza);
        //print_r($size);
        $n_height = 50 * $size[1] / $size[0];
        if ($n_height > $height) {
            $height = $n_height;
        }
        //echo $n_height.'<hr />';
    }
    $height = round($height);
    echo '<div style="display:inline;">';
    foreach ($pics as $p) {
        echo '<div class="sa_view_pic" style="height:' . $height . 'px;">';
        echo '<a class="modal" rel="{handler: \'iframe\', size: {x: 750, y: 600}}" href="' . $img_path . $p->poza . '"><img src="' . $img_path . $p->poza . '" alt="' . $p->alt . '" width="50" border="0" /></a>';
        echo '</div>';
    }
    echo '</div>';
    echo '<div style="clear:both;"></div>';
}
 /**
  * Method to get the field input markup for a spacer.
  * The spacer does not have accept input.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $apiHelper = new mauticApiHelper();
     $settings = $apiHelper->getApiSettings();
     $url = Juri::root() . 'administrator/?plugin=mautic';
     $text = 'PLG_MAUTIC_AUTHORIZE_BTN';
     if (!empty($settings['accessToken'])) {
         $url .= '&reauthorize=true';
         $text = 'PLG_MAUTIC_REAUTHORIZE_BTN';
     } else {
         $url .= '&authorize=true';
     }
     if (!empty($settings['clientKey']) && !empty($settings['clientSecret'])) {
         // Note: style is added for Joomla 2.5
         $btn = Jhtml::link($url, JText::_($text), array('class' => 'btn btn-small btn-success', 'style' => 'float: left;'));
         if (!empty($settings['accessToken'])) {
             $resetUrl = Juri::root() . 'administrator/?plugin=mautic&reset=true';
             $btn .= ' <span style="float: left;  padding: 0 4px;">|</span> ';
             $btn .= Jhtml::link($resetUrl, JText::_('PLG_MAUTIC_RESET_BTN'), array('class' => 'btn btn-small btn-default pull-right', 'style' => 'float: left;'));
         }
         return $btn;
     } else {
         return JText::_('PLG_MAUTIC_SAVE_KEYS_FIRST');
     }
 }
Example #3
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     jimport('joomla.filesystem.folder');
     $component = $this->element['component'];
     $customfields = array();
     $options = array();
     $files = JFolder::files(JPATH_LIBRARIES . '/compojoom/form/customfields');
     foreach ($files as $file) {
         $customfields[] = basename($file, '.php');
     }
     $componentPath = JPATH_ADMINISTRATOR . '/components/' . $component . '/models/fields/customfields';
     $overridePath = JPATH_SITE . '/templates/' . CompojoomTemplateHelper::getFrontendTemplate() . '/html/' . $component . '/fields/customfields';
     if (file_exists($componentPath)) {
         $files = JFolder::files($componentPath);
         foreach ($files as $file) {
             $customfields[] = basename($file, '.php');
         }
     }
     if (file_exists($overridePath)) {
         $files = JFolder::files($overridePath);
         foreach ($files as $file) {
             $file = basename($file, '.php');
             if (!in_array($file, $customfields)) {
                 $customfields[] = $file;
             }
         }
     }
     foreach ($customfields as $customfield) {
         $options[] = Jhtml::_('select.option', $customfield, $customfield);
     }
     return $options;
 }
    protected function getInput()
    {
        Jhtml::_('jquery.framework');
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration('jQuery(function($) {
			$("#btn-reset-thumbs").on("click", function() {
				$(this).attr("disabled","disabled").text($(this).data("generating"));
			});
		});');
        $url = 'index.php?option=com_spsimpleportfolio&view=thumbs&task=resetThumbs';
        return '<a id="btn-reset-thumbs" class="btn btn-primary" data-generating="' . JText::_('COM_SPPORTFOLIO_RESET_THUMBNAIL_TEXT_LOADING') . '" href="' . $url . '">' . JText::_('COM_SPPORTFOLIO_RESET_THUMBNAIL_TEXT') . '</a>';
    }
Example #5
0
    protected function getInput()
    {
        Jhtml::_('behavior.modal');
        $app = JFactory::getApplication();
        $document = JFactory::getDocument();
        $document->addScript(JURI::root(true) . '/modules/' . $this->form->getValue('module') . '/admin/js/jquery.dragsort.min.js');
        $document->addScript(JURI::root(true) . '/modules/' . $this->form->getValue('module') . '/admin/js/juupload.min.js');
        $document->addScript(JURI::root(true) . '/modules/' . $this->form->getValue('module') . '/admin/js/jugallery.min.js');
        JText::script('TITLE');
        JText::script('LINK');
        JText::script('CLASS');
        JText::script('DESCRIPTION');
        JText::script('PUBLISHED');
        JText::script('UPDATE');
        JText::script('CANCEL');
        JText::script('DELETE_IMAGE_CONFIRM');
        JText::script('FOLDER_PATH_REQUIRED');
        JText::script('FOLDER_EMPTY');
        JText::script('PLEASE_SELECT_FILE');
        JText::script('SELECT_FILE');
        $params = new JRegistry($this->form->getValue('params'));
        $folderfield = (string) $this->element['folderfield'];
        $foldername = $params->get($folderfield, 'images/');
        if (substr($foldername, 0, 1) == '/') {
            $params->set($folderfield, substr($foldername, 1));
        }
        if (substr(trim($foldername), -1) != '/') {
            $params->set($folderfield, trim($foldername) . '/');
        }
        //Create element
        if ($app->isAdmin()) {
            $html = '<div class="juuploader"><div class="file-display">' . JText::_("SELECT_FILE") . '</div><input class="upload-file" type="file" name="' . $this->id . '_img_upload" id="' . $this->id . '_img_upload" multiple  accept="image/*" /><button type="button" class="btn-upload">' . JText::_("UPLOAD") . '</button></div>';
        }
        $html .= '<input type="button" class="jureloadimages" title="' . JText::_("RELOAD_IMAGES") . '" value="' . JText::_("RELOAD_IMAGES") . '" style="display: block;" />';
        $html .= '<div class="upload-message"></div>';
        $html .= '<div class="jugallery-holder"></div>';
        $html .= '<textarea rows="6" cols="60" class="jugallery-description ' . $this->element['class'] . '" name="' . $this->name . '" id="' . $this->id . '" style="display: none;">' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</textarea>';
        $js = '
		var module_url = "' . JURI::root(true) . '/modules/' . $this->form->getValue('module') . '/";
		JU_jQuery(document).ready(function($){
			$(\'#' . $this->id . '\').jugallery({ju_folderfield: \'jform_params_' . $folderfield . '\', description_field_id:\'' . $this->id . '\'});';
        if ($app->isAdmin()) {
            $js .= '
				$(\'#' . $this->id . '\').parent().find(\'.juuploader\').juupload({ju_folderfield: \'jform_params_' . $folderfield . '\', description_field_id:\'' . $this->id . '\'});';
        }
        $js .= '
		});';
        $document->addScriptDeclaration($js);
        return $html;
    }
Example #6
0
function view_pictures($id, $uid)
{
    Jhtml::_('behavior.modal');
    $img_path = JURI::root() . "components" . DS . "com_sauto" . DS . "assets" . DS . "users" . DS . $uid . DS;
    $db = JFactory::getDbo();
    $query = "SELECT * FROM #__sa_poze WHERE `id_anunt` = '" . $id . "' ORDER BY `id` ASC";
    $db->setQuery($query);
    $pics = $db->loadObjectList();
    echo '<div style="display:inline;">';
    foreach ($pics as $p) {
        echo '<div style="float:left;padding:5px;">';
        echo '<a class="modal" rel="{handler: \'iframe\', size: {x: 750, y: 600}}" href="' . $img_path . $p->poza . '"><img src="' . $img_path . $p->poza . '" alt="' . $p->alt . '" width="50" border="0" /></a>';
        echo '</div>';
    }
    echo '</div>';
    echo '<div style="clear:both;"></div>';
}
Example #7
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     jimport('joomla.filesystem.folder');
     $options = array('0' => JText::_('LIB_COMPOJOOM_NONE'));
     $components = JFolder::files(JPATH_LIBRARIES . '/compojoom/avatars/avatars');
     $isPro = (int) $this->element['isPro'];
     foreach ($components as $component) {
         $disabled = true;
         $component = str_replace('.php', '', $component);
         // Disable this option if the component is not installed, or if we are not in a PRO extension
         if (CompojoomComponentHelper::isInstalled('com_' . $component) && $isPro) {
             $disabled = false;
         }
         $options[] = Jhtml::_('select.option', $component, JText::_('LIB_COMPOJOOM_COM_' . strtoupper($component)), 'value', 'text', $disabled);
     }
     return $options;
 }
Example #8
0
<input type="hidden" name="view" value="' . JRequest::getVar('view') . '" />
<input type="hidden" name="Itemid" value="' . JRequest::getVar('Itemid') . '" />
<input type="hidden" name="id" value="' . JRequest::getVar('id') . '" />
<input type="hidden" name="task" value="' . $this->viewName . '.save" />
<input type="hidden" name="fileName" value="' . $this->Item->fileName . '" />
<p class="formButtons">
     <button type="button" class="btnCheck" onclick="checkClick()">' . JText::_('CHECK') . '</button>
     <button type="button" class="btnOK" onclick="submitbutton(' . "'components.save'" . ')">' . JText::_('OK') . '</button>
     <button type="button" class="btnCancel" onclick="submitbutton(' . "'" . $this->viewName . ".cancel'" . ')">' . JText::_('CANCEL') . '</button>
</p>
<p>
  <textarea name="lines" id="lines" cols="100" rows="20" style="width:100%">' . implode('', $this->Item->lines) . '</textarea>
  <iframe name="ifrmCheck" height="150" width="100%"></iframe>
</p>
';
echo Jhtml::_('form.token');
$this->showFooter();
echo '</form>
</div>
</div>
<script type="text/javascript">
  submitbutton = function(task)  {
    var s = editAreaLoader.getValue("lines");
    s = s.replace("\\<textarea\\>","{textarea}");
    s = s.replace("\\<\\/textarea\\>","{/textarea}");
    document.getElementById("adminForm").target = "";
    document.getElementById("adminForm").lines.value = s;
    document.getElementById("adminForm").task.value = task;
 		document.getElementById("adminForm").submit();
  }
  tabClick = function(name) {
Example #9
0
            <div class="well">
                <h3><?php 
echo JText::_('COM_CHPANEL_ANY_FIELDSET_IMAGE');
?>
</h3>
                <div class="control-group muted">
					<?php 
echo JText::sprintf('COM_CHPANEL_ANY_IMAGE_DESC', $this->params->get('img_upload', 1500));
?>
                </div>
				<?php 
if ($this->image) {
    ?>
					<div class="control-group">
						<?php 
    echo Jhtml::image(JURI::root() . 'images/chpanel/images/' . $this->item->id . '-small.jpg?rand=' . rand(1, 999), $this->item->title, 'class="thumbnail"');
    ?>
					</div>
					<div class="control-group">
						<label class="checkbox hasTooltip" title="<?php 
    echo JText::_('COM_CHPANEL_ANY_IMAGE_DELETE');
    ?>
::<?php 
    echo JText::_('COM_CHPANEL_ANY_IMAGE_DELETE_DESC');
    ?>
">
							<input type="checkbox" name="image_delete" value="1"><?php 
    echo JText::_('COM_CHPANEL_ANY_IMAGE_DELETE');
    ?>
						</label>
					</div>
					<td><?php 
    echo $this->location->website;
    ?>
</td>
				</tr>
			<?php 
}
?>
			<?php 
if ($this->location != null && !empty($this->location->gmaploc)) {
    ?>
				<tr>
				<td colspan="2">
				<div id="mat_map">
					<?php 
    Jhtml::_('behavior.framework');
    $api = 'http://maps.googleapis.com/maps/api/js?sensor=false';
    $uri = JURI::getInstance();
    if ($uri->isSSL()) {
        $api = 'https://maps.googleapis.com/maps/api/js?sensor=false';
    }
    $document = JFactory::getDocument();
    $document->addScript($api);
    $location = $this->location->gmaploc;
    $script = "window.addEvent('domready', function() {\r\n\r\n\t                    geocoder = new google.maps.Geocoder();\r\n\t                    var myOptions = {\r\n\t                        zoom:8,\r\n\t                        mapTypeId:google.maps.MapTypeId.ROADMAP\r\n\t                    };\r\n\t                    var map = new google.maps.Map(document.getElementById('map_canvas'),\r\n\t                              myOptions);\r\n\t                    var address = '" . preg_replace("#\n|\r#", ' ', str_replace('<br />', ',', $location)) . "';\r\n\t                    geocoder.geocode( { 'address': address}, function(results, status) {\r\n\t                    if (status == google.maps.GeocoderStatus.OK) {\r\n\t                        map.setCenter(results[0].geometry.location);\r\n\t                        var marker = new google.maps.Marker({\r\n\t                        map: map,\r\n\t                        position: results[0].geometry.location\r\n\t                    });\r\n\r\n\t                    var infowindow = new google.maps.InfoWindow({\r\n\t                        content: address\r\n\t                    });\r\n\t                    google.maps.event.addListener(marker, 'click', function() {\r\n\t                        infowindow.open(map,marker);\r\n\t                    });\r\n\r\n\t                    } else {\r\n\t                        alert('Geocode was not successful for the following reason: ' + status);\r\n\t                    }\r\n\t                    });\r\n\r\n\t                    });";
    $document->addScriptDeclaration($script);
    ?>
					<a title="<?php 
    JTEXT::_('COM_MATUKIO_MAP');
    ?>
" class="modal cjmodal" href="<?php 
Example #11
0
 function setPosition($name, $title = '')
 {
     $title = !empty($title) ? $title : $name;
     $legend = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][legend]" value="' . htmlspecialchars(@$this->positions[$name]->legend) . '" size="22" />';
     $variat = Jhtml::_('select.genericlist', $this->variations, 'ffp[pos-' . $name . '][variation]', 'size="1" class="thin blue c_var_ck"', 'value', 'text', $this->positions[$name]->variation, 'pos-' . $name . '_variation');
     $variat .= '<input type="hidden" id="pos-' . $name . '_variation_options" name="ffp[pos-' . $name . '][variation_options]" value="' . htmlspecialchars(@$this->positions[$name]->variation_options) . '" />';
     $width = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][width]" value="' . @$this->positions[$name]->width . '" size="8" style="text-align:center;" /> x&nbsp;';
     $height = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][height]" value="' . @$this->positions[$name]->height . '" size="8" style="text-align:center;" />';
     $css = '';
     Helper_Workshop::displayPosition($this->p, $name, '# ' . $title, $legend, $variat, @$this->positions[$name]->variation, $width, $height, $css);
     $this->p++;
     return $name;
 }
Example #12
0
    protected function getInput()
    {
        Jhtml::_('behavior.modal');
        Jhtml::_('stylesheet', JURI::root() . 'modules/' . $this->form->getValue('module') . '/assets/elements/jagallery/style.css');
        $jaGalleryId = $this->id;
        $params = $this->form->getValue('params');
        if (!isset($params)) {
            $params = new stdClass();
            $params->folder = '';
        }
        if (!isset($params->folder)) {
            $params->folder = '';
        } else {
            $params->folder = trim($params->folder, '/') . '/';
        }
        //Check data format && convert it to json data if it is older format
        $updateFormatData = 0;
        if ($this->value && !$this->isJson($this->value)) {
            $this->value = $this->convertFormatData($this->value, $params->folder);
            if (isset($this->element["updatedata"]) && $this->element["updatedata"]) {
                $updateFormatData = 1;
            }
        }
        //Create element
        $button = '<input type="button" id="jaGetImages" value="' . JText::_("JA_GET_IMAGES") . '" style="display: none;" /><br /><div id="listImages" style="width: 100%; overflow: hidden;"></div>';
        $button .= '<textarea style="width: 75%; display: none;" rows="6" cols="75" name="' . $this->name . '" id="' . $jaGalleryId . '" >' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</textarea>';
        $js = ' 
		var current_jagallery = \'' . addslashes($this->value) . '\';
		var current_jafolder = "' . $params->folder . '";
		var autoUpdate = ' . $updateFormatData . ';
		jQuery(document).ready(function(){			 
			jQuery("#jaGetImages").click(function(){
				jaListImages();
			});
			jaListImages();			
			if(autoUpdate){
				Joomla.submitbutton("module.apply");
			}
		});
		function changetype(obj){
			
			jaListImages(jQuery(obj).val());
			
		}
		function jaListImages(type){
			var folder_path = jQuery("#jform_params_folder").val();					
			if(folder_path == ""){
				alert("' . JText::_("FOLDER_PATH_REQUIRED") . '");
				return;
			}
			query = "jarequest=images&path="+folder_path+"&task=loadImages";		
			if(type) query+="&type="+type;	
			jQuery.ajax({
				url: location.href,
				data: query,
				type: "post",
				beforeSend: function(){
					jQuery("#listImages").html("<img src=\\"' . JURI::root() . 'modules/mod_jaslideshowlite/assets/elements/jagallery/loading.gif\\" width=\\"30\\" height=\\"30\\" />");
				},
				success: function(responseJSON){
						var data = jQuery.parseJSON(responseJSON);
						if (!data.success) {
							jQuery("#' . $jaGalleryId . '").val("");
							jQuery("#listImages").html("<strong style=\'color: red\'>' . JText::_("FOLDER_EMPTY") . '</strong>");
							return;	
						}
						else {
							if(folder_path === current_jafolder && current_jagallery != ""){
								var current_data = jQuery.parseJSON(current_jagallery);
								for(var i=0; i<current_data.length; i++){
									for(var j=0; j<data.images.length; j++){
										if(current_data[i].image == data.images[j].image){
											if(typeof(current_data[i].title) !== "undefined"){
												data.images[j].title 		= current_data[i].title;
											}
											if(typeof(current_data[i].link) !== "undefined"){
												data.images[j].link 		= current_data[i].link;
											}
											if(typeof(current_data[i].description) !== "undefined"){		
												data.images[j].description 	= current_data[i].description;
											}
											if(typeof(current_data[i].class) !== "undefined"){
												data.images[j].class 		= current_data[i].class;
											}
											if(typeof(current_data[i].show) !== "undefined"){
												data.images[j].show 		= current_data[i].show;
											}
											break;
										}
									}
								}
							}
							jaupdateImages(data.images, "#listImages");
						}

				}					
			});
			
			return false;
		}
		
		function jaupdateImages(images, boxID){
			var data = "";
			if(images.length){
				for(var i=0; i<images.length; i++){
					var showImage = "";
					if(images[i].show === true || images[i].show === "true"){
						showImage = "checked";
					}
					data += "<div class=\'img-element\' style=\'width: 100px; height: 150px; float: left; margin: 0 5px;\'>";
					data += 	"<img src="+ encodeURI(images[i].imageSrc) +" style=\'max-width: 100px; max-height: 100px;\' />";
					data += 	"<br />";
					data += 	"<span style=\\"font-size:80%;\\">["+images[i].image+"]</span>";
					data += 	"<br />";
					data += 	"<span style=\'float: left; display: block; text-align: center\'>";	
					data += 	"' . JText::_("JSHOW") . ' <input style=\'margin:0 auto;\' type=\'checkbox\' value=\'" + images[i].image + "\' "+showImage+" onchange=\'showImage(this)\' />";	
					data += 	"</span>";
					data += 	"<span onclick=\'jaFormpopup(\\"#img-element-data-form\\", " + i + ", \\"" + images[i].image + "\\"); return false;\' class=\'img-btn\' style=\'float: right; text-align: center; display: block; cursor: pointer;\'>' . JText::_("EDIT") . ' </span>";
					data += "</div>";
				}
				data += "<div id=\'img-element-data-form\' style=\'display: none;\'></div>";
			}
			jQuery(boxID).html(data);
			jQuery("#' . $jaGalleryId . '").val(JSON.stringify(images));		
		}
		
		function showImage(el){
			var showImage = jQuery(el).is(\':checked\');
			var data = jQuery.parseJSON(jQuery("#' . $jaGalleryId . '").val());
			
			if(!data){ 
				data = [];
			}
			if(data.length  > 0){
				for(var i = 0; i<data.length; i++){
					if(data[i]["image"] == jQuery(el).val()){										
						data[i]["show"] = showImage;
						break;
					}					
				}				
			}
			jQuery("#' . $jaGalleryId . '").val(JSON.stringify(data));
		}
		
		function jaFormpopup(el, key, imgname){
			var form = jadataForm(key, imgname);			
			jQuery(el).append(form);
			SqueezeBox.open($("img-element-data-form-"+key),{
                handler:"adopt",
                size:{
                    x:800,
                    y:321
                }
            });
			//update data for image form
			var data = jQuery("#' . $jaGalleryId . '").val();
			var jaimg = new Object();
			jaimg.title = "";
			jaimg.link = "";
			jaimg.description = "";
			jaimg.class="";
			//query = "jarequest=images&task=validData&imgname="+imgname+"&data="+data;
			jQuery.ajax({
				url: location.href,
				data: {jarequest:"images", task:"validData", imgname:imgname, data:data},
				type: "post",				
				success: function(responseJSON){					
					var jaResponse = jQuery.parseJSON(responseJSON);					
					jQuery("#img-element-data-form-"+key).find("#imgtitle").val(jaResponse.title);
					jQuery("#img-element-data-form-"+key).find("#imglink").val(jaResponse.link);
					jQuery("#img-element-data-form-"+key).find("#imgdescription").val(jaResponse.description);
					jQuery("#img-element-data-form-"+key).find("#imgclass").val(jaResponse.class);
				}					
			});
		}
		
		function jaCloseImgForm(key){
			SqueezeBox.close($("img-element-data-form-"+key));
		}
		
		function jaUpdateImgData(key, imgname){
			
			var title = jQuery("#img-element-data-form-"+key).find("#imgtitle").val();
			var link = jQuery("#img-element-data-form-"+key).find("#imglink").val();
			var description = jQuery("#img-element-data-form-"+key).find("#imgdescription").val();		
			var imgclass	= jQuery("#img-element-data-form-"+key).find("#imgclass").val();
			var data = jQuery.parseJSON(jQuery("#' . $jaGalleryId . '").val());
			
			if(!data){ data = [];}
			
			if(data.length  > 0){
				var found = false;

				for(var i = 0; i<data.length; i++){				
					if(data[i]["image"] == imgname){										
						data[i]["title"] = title;	
						data[i]["link"] = link;	
						data[i]["description"] = description;	
						data[i]["class"] = imgclass;																				 	

						found = true;
						break;
					} 				
				}

				if(!found){
    				data_add = new Object();
    				data_add["image"] = imgname;		
	    			data_add["title"] = title;	
					data_add["link"] = link;	
					data_add["description"] = description;	
					data_add["class"] = imgclass;
					data.push(data_add);
				}
			} else {
				data_add = new Object();	
				data_add["image"] = imgname;		
    			data_add["title"] = title;	
				data_add["link"] = link;	
				data_add["description"] = description;	
				data_add["class"] = imgclass;
				data.push(data_add);
    		}
			
			jQuery("#' . $jaGalleryId . '").val(JSON.stringify(data));
			
			jaCloseImgForm(key);
		}
		
		function jadataForm(key, imgname){
			
			//create form for image data
			var html = "";		
			html += "<div id=\'img-element-data-form-"+key+"\' class=\'img-element-data-form\'>";
				html += "<fieldset class=\'panelform\' >";	
					html += "<ul>";
						html += "<li>";
							html += "<label>' . JText::_("JA_TITLE") . '</label>";
							html += "<input type=\'text\' name=\'imgtitle\' id=\'imgtitle\' value=\'\' size=\'50\' />";
						html += "</li>";	
								
						html += "<li>";
							html += "<label>' . JText::_("JA_LINK") . '</label>";
							html += "<input type=\'text\' name=\'imglink\' id=\'imglink\' value=\'\' size=\'50\' />";
						html += "</li>";
						html += "<li>";
							html += "<label>' . JText::_("JA_CLASS") . '</label>";
							html += "<input type=\'text\' name=\'imgclass\' id=\'imgclass\' value=\'\' size=\'50\' />";
						html += "</li>";
						html += "<li>";
							html += "<label>' . JText::_("JA_DESCRIPTION") . '</label>";
							html += "<textarea rows=\'6\' cols=\'80\' name=\'imgdescription\' id=\'imgdescription\' ></textarea>";
						html += "</li>";
												
					html += "</ul>";
					html += "<div class=\'btn-image-data-popup\' style=\'width: 100%; display: block; float: left; margin-top: 10px;\'>";
					html += "<input onclick=\'jaUpdateImgData("+key+", \\""+imgname+"\\"); return false;\' type=\'button\' value=\'' . JText::_("UPDATE") . '\' >";
					html += "<input onclick=\'jaCloseImgForm("+key+"); return false;\' type=\'button\' value=\'' . JText::_("CANCEL") . '\' >";						
					html += "</div>";						
				html += "</fieldset>";
			html += "</div>";
			
			return html;
		}
		';
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($js);
        return $button;
    }
Example #13
0
?>
</th>
        <th><?php 
echo Jhtml::_('grid.sort', 'JOTCACHE_RS_ID', 'm.id', $this->lists['order_Dir'], $this->lists['order']);
?>
</th>
        <th nowrap="nowrap"><?php 
echo Jhtml::_('grid.sort', 'JOTCACHE_RS_CREATED', 'm.ftime', $this->lists['order_Dir'], $this->lists['order']);
?>
</th>
        <th nowrap="nowrap"><?php 
echo Jhtml::_('grid.sort', 'JOTCACHE_RS_LANG', 'm.language', @$this->lists['order_Dir'], @$this->lists['order']);
?>
</th>
        <th nowrap="nowrap"><?php 
echo Jhtml::_('grid.sort', 'JOTCACHE_RS_BROWSER', 'm.browser', @$this->lists['order_Dir'], @$this->lists['order']);
?>
</th>
        <?php 
if ($showcookies) {
    ?>
          <th nowrap="nowrap"><?php 
    echo JText::_('JOTCACHE_RS_COOKIES');
    ?>
</th>
        <?php 
}
?>
        <th nowrap="nowrap"><?php 
echo JText::_('JOTCACHE_RS_MARK');
?>
$variat = $app->input->getString('variat', '');
$values = getOptions($live);
$variations = getOptions($variat);
// Variations
$opts = array(JHtml::_('select.option', '', '- ' . JText::_('COM_CCK_INHERITED') . ' -'), JHtml::_('select.option', 'clear', JText::_('COM_CCK_CLEAR')), JHtml::_('select.option', 'hidden', JText::_('COM_CCK_HIDDEN')), JHtml::_('select.option', 'value', JText::_('COM_CCK_VALUE')), JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_FORM')), JHtml::_('select.option', 'form', JText::_('COM_CCK_DEFAULT')), JHtml::_('select.option', 'form_filter', JText::_('COM_CCK_FORM_FILTER')), JHtml::_('select.option', 'disabled', JText::_('COM_CCK_FORM_DISABLED')), JHtml::_('select.option', '</OPTGROUP>', ''));
// Process
require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_workshop.php';
$fields = Helper_Workshop::getFields($elem, $item, 'AND (( c.live = "" AND c.live_value = "" ) OR ( c.live = "" AND c.live_value != "" AND c.variation != "hidden" ) OR ( c.live != "" AND c.live != "stage" ))', false, true);
if (count($fields)) {
    foreach ($fields as $pos) {
        foreach ($pos as $field) {
            $value = isset($values[$field->name]) ? htmlspecialchars($values[$field->name]) : '';
            $variat = isset($variations[$field->name]) ? $variations[$field->name] : '';
            $variat = $variat == 'none' ? $variat = 'hidden' : $variat;
            // TODO: FIX TO REMOVE AFTER GA
            $variation = Jhtml::_('select.genericlist', $opts, 'variation_' . $field->name, 'size="1" class="inputbox variation_values" onchange="CCK_setOptions(\'variation\');"', 'value', 'text', $variat);
            $html .= '<label style="padding-left: 10px;">' . $field->title . '</label>' . '<input class="live_values inputbox" type="text" id="live_' . $field->name . '" name="live_' . $field->name . '" value="' . $value . '" onchange="CCK_setOptions(\'live\');" />' . $variation . '<div class="clear"></div>';
        }
    }
}
echo $html;
?>

<script type="text/javascript">
function CCK_setOptions(type) {
	var elem = jQuery("#jform_params_"+type);
	var len = type.length + 1;
	var res = "";
	jQuery("."+type+"_values").each(function (i) {
		v = jQuery(this).val();
		v = encodeURIComponent(v);
Example #15
0
 * @desc Shows the dialog for the content translation
 */
if ($this->showMessage) {
    echo $this->loadTemplate('message');
}
$act = $this->act;
$task = $this->task;
$select_language_id = $this->select_language_id;
$user = JFactory::getUser();
$db = JFactory::getDBO();
$elementTable = $this->actContentObject->getTable();
$input = JFactory::getApplication()->input;
$document = JFactory::getDocument();
$document->addScript('components/com_falang/assets/js/mambojavascript.js');
//use for images type
Jhtml::_('behavior.modal');
//use for validation
JHTML::_('behavior.formvalidation');
//use to name form to allow form validation
$idForm = 'adminForm';
switch ($elementTable->Name) {
    case 'modules':
        $idForm = 'module-form';
        //add view-module for widgetkit support
        $input->set('view', 'module');
        break;
    case 'banners':
        $idForm = 'banner-form';
        break;
    case 'menu':
        $idForm = 'item-form';
Example #16
0
    }
    $j++;
    ?>
	<li class="form-group" <?php 
    echo $style;
    ?>
>
		<label class="group-label control-label">
			<?php 
    echo JText::_('JAK2_KEYWORD');
    ?>
			<?php 
    if ($display_keyword_tip) {
        ?>
			<sup><?php 
        echo Jhtml::tooltip(JText::_('JAK2_KEYWORD_HINT'), JText::_('JAK2_HINT'), '', ' [?]', '', 'Tooltip', 'ja-k2filter-tip');
        ?>
</sup>
			<?php 
    }
    ?>
		</label>
		<input type="text" name="searchword" id="searchword<?php 
    echo $module->id;
    ?>
" class="form-control"
			   value="<?php 
    echo htmlspecialchars(JRequest::getVar('searchword', ''));
    ?>
"
			   placeholder="<?php 
Example #17
0
 function selectOrderDir($selected)
 {
     $imgSrc = JURI::root() . 'media/system/images/sort_' . (strtolower($selected) == 'desc' ? 'desc' : 'asc') . '.png';
     $url = 'javascript:document.auctionForm.filter_order_Dir.value=\'' . (strtolower($selected) == 'desc' ? 'ASC' : 'DESC') . '\';document.auctionForm.submit();';
     return Jhtml::link($url, JHtml::image($imgSrc, $selected));
 }
 /**
  * Method to get the textarea field input markup.
  * Use the rows and columns attributes to specify the dimensions of the area.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $document = JFactory::getDocument();
     // Translate placeholder text
     $hint = $this->translateHint ? JText::_($this->hint) : $this->hint;
     // Initialize some field attributes.
     $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
     $disabled = $this->disabled ? ' disabled' : '';
     $readonly = $this->readonly ? ' readonly' : '';
     $columns = $this->columns ? ' cols="' . $this->columns . '"' : '';
     $rows = $this->rows ? ' rows="' . $this->rows . '"' : '';
     $required = $this->required ? ' required aria-required="true"' : '';
     $hint = $hint ? ' placeholder="' . $hint . '"' : '';
     $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"';
     $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete;
     $autofocus = $this->autofocus ? ' autofocus' : '';
     $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"';
     // Initialize JavaScript field attributes.
     $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
     $onclick = $this->onclick ? ' onclick="' . $this->onclick . '"' : '';
     $path = JURI::root() . $this->element['path'];
     // Including fallback code for HTML5 non supported browsers.
     JHtml::_('behavior.framework');
     Jhtml::_('behavior.modal');
     JHtml::_('script', 'system/html5fallback.js', false, true);
     $document->addStyleSheet(JURI::root() . 'modules/mod_jagooglechart/asset/elements/jaimportcsv/style.css');
     $js = "function jaImportForm(){\r\n\t\t\tvar form = jaBuildForm();\r\n\t\t\tjQuery('#ja-import-csv-layout').append(form);\r\n\t\t\tSqueezeBox.open(\$('ja-import-csv'),{\r\n                handler:'adopt',\r\n                size:{\r\n                    x:800,\r\n                    y:375\r\n                }\r\n            });\r\n\t\t}\r\n\r\n\t\tfunction jaBuildForm(){\r\n\t\t\tvar html = '';\r\n\t\t\thtml += '<div id=\"ja-import-csv\">';\r\n\t\t\t\thtml += '<fieldset class=\"panelform\" >';\r\n\t\t\t\t\thtml += '<legend>" . JText::_("MOD_JA_GOOGLE_CHART_IMPORT_FROM_CSV") . "</legend>';\r\n\t\t\t\t\thtml += '<form id=\"ja-import-csv-form\" action=\"'+location.href+'&jarequest=jaimportcsv&task=import\" method=\"POST\" enctype=\"multipart/form-data\" >';\r\n\t\t\t\t\t\thtml += '<div class=\"ja-import-csv-input\">';\r\n\t\t\t\t\t\thtml += '<input type=\"file\" name=\"file\" value=\"\" id=\"csv_file\" />';\r\n\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\thtml += '<div id=\"ja-import-csv-progress\">';\r\n\t\t\t\t\t\t\thtml += '<div id=\"ja-import-csv-bar\"></div>';\r\n\t\t\t\t\t\t\thtml += '<div id=\"ja-import-csv-percent\">0%</div>';\r\n\t\t\t\t\t\thtml += '</div>';\r\n\t\t\t\t\t\thtml += '<br />';\r\n\t\t\t\t\t\thtml += '<input type=\"submit\" onclick=\"jaImportCsvFormSubmit(this.form)\" value=\"" . JText::_("MOD_JA_GOOGLE_CHART_LOADING_CSV_BTN") . "\" />';\r\n\t\t\t\t\thtml += '</form>';\r\n\t\t\t\t\thtml += '<div id=\"ja-import-csv-result\">';\r\n\t\t\t\t\t\thtml += '<fieldset>';\r\n\t\t\t\t\t\t\thtml += '<legend>" . JText::_("MOD_JA_GOOGLE_CHART_DATA_LOADED") . "</legend>';\r\n\t\t\t\t\t\t\thtml += '<span id=\"ja-import-csv-error-msg\" ></span>';\r\n\t\t\t\t\t\t\thtml += '<textarea cols=\"25\" rows=\"10\" id=\"ja-import-csv-data\"></textarea>';\r\n\t\t\t\t\t\t\thtml += '<input type=\"button\" onclick=\"jaImportCsv()\" value=\"" . JText::_("MOD_JA_GOOGLE_CHART_IMPORT_BTN") . "\" />';\r\n\t\t\t\t\t\thtml += '</fieldset>';\r\n\t\t\t\t\thtml += '</div>';\r\n\t\t\t\thtml += '</fieldset>';\r\n\t\t\thtml += '</div>';\r\n\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t    function jaImportCsvFormSubmit(form){\r\n\t\t    var bar = \$('ja-import-csv-bar')\r\n\t\t\tvar percent = \$('ja-import-csv-percent')\r\n\t\t\tvar result = \$('ja-import-csv-data')\r\n\t\t\tvar percentValue = '0%';\r\n\r\n\t\t\tvar fileInput = \$('csv_file');\r\n\t\t\tvar form = \$('ja-import-csv-form');\r\n\r\n\t\t\tform.addEventListener('submit', function(evt) {\r\n\t\t\tevt.preventDefault();\r\n\r\n\t\t\t// Ajax upload\r\n\t\t\tvar file = fileInput.files[0];\r\n\r\n\t\t\tvar fd = new FormData();\r\n\t\t\tfd.append('file', file);\r\n\r\n\t\t\tvar xhr = new XMLHttpRequest();\r\n\t\t\txhr.open('POST', location.href+'&jarequest=jaimportcsv&task=import', true);\r\n\r\n\t\t\txhr.upload.onprogress = function(e) {\r\n\t\t\t  if (e.lengthComputable) {\r\n\t\t\t\tvar percentValue = (e.loaded / e.total) * 100 + '%';\r\n\t\t\t\tpercent.innerHTML  = percentValue;\r\n\t\t\t\tbar.setAttribute('style', 'width: ' + percentValue);\r\n\t\t\t  }\r\n\t\t\t};\r\n\r\n\t\t\txhr.onload = function() {\r\n\t\t\t  if (this.status == 200) {\r\n\t\t\t\tvar response = JSON.parse(this.response);\r\n\t\t\t\tif(response.status==1){\r\n\t\t\t\t\t\$('ja-import-csv-error-msg').innerHTML = response.message;\r\n\t\t\t\t\tresult.innerHTML = response.data;\r\n\t\t\t\t\tpercent.innerHTML  = '100%';\r\n\t\t\t\t\tbar.setAttribute('style', 'width: 100%;' );\r\n\t\t\t\t}else{\r\n\t\t\t\t\t\$('ja-import-csv-error-msg').innerHTML = response.message;\r\n\t\t\t\t\tresult.innerHTML = '';\r\n\t\t\t\t}\r\n\t\t\t  };\r\n\t\t\t};\r\n\r\n\t\t\txhr.send(fd);\r\n\r\n\t\t  }, false);\r\n\t\t}\r\n\r\n\t\tfunction jaImportCsv(){\r\n\t\t\tvar data = \$('ja-import-csv-data').value;\r\n\t\t\tif(!data){\r\n\t\t\t    \$('ja-import-csv-error-msg').innerHTML = 'Data null';\r\n\t\t\t    return;\r\n\t\t\t}\r\n\t\t\t\$('jform_params_data_input').value = data;\r\n\t\t\tSqueezeBox.close(\$('ja-import-csv'));\r\n\t\t}\r\n\t\t";
     $document->addScriptDeclaration($js);
     $html = '';
     $html .= '<textarea name="' . $this->name . '" id="' . $this->id . '"' . $columns . $rows . $class . $hint . $disabled . $readonly . $onchange . $onclick . $required . $autocomplete . $autofocus . $spellcheck . ' >' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</textarea>';
     $html .= '<br />';
     $html .= '<button type="button" class="img-btn" onclick="jaImportForm(); return false;">' . JText::_("MOD_JA_GOOGLE_CHART_IMPORT_CSV_BTN") . '</button>';
     $html .= '<div id="ja-import-csv-layout" style="display: none;"></div>';
     return $html;
 }
</span></span>
			</div>
			<div class="sp-accordion-container">
				<div class="sp-accordion-inner">
					<?php 
    if ($showauthor || $showdate) {
        ?>
						<div class="sp-accordion-info">
							<?php 
        if ($showauthor) {
            echo '<small class="sp-accordion-author">' . JText::_('WRITTEN') . ' ' . $item->author . '</small>';
        }
        ?>
							<?php 
        if ($showauthor) {
            echo '<small class="sp-accordion-date">' . JText::_('JON') . ' ' . Jhtml::_('date', $item->created, JText::_($date_format)) . '</small>';
        }
        ?>
						</div>
					<?php 
    }
    ?>
					<?php 
    echo $item->introtext;
    ?>
					<?php 
    if ($showreadon) {
        ?>
						<a class="readmore" href="<?php 
        echo $item->link;
        ?>
Example #20
0
 /**
  * Gets the user avatar image without any link
  * 
  * @param unknown $system
  * @param unknown $userid
  * @param unknown $alt
  * @param number $height
  * @param string $email
  * @param string $path_only
  * @param unknown $attribs
  * @return void|Ambigous <string, unknown, NULL, string>
  */
 public static function get_user_avatar_image($system, $userid, $alt, $height = 48, $email = null, $path_only = true, $attribs = array())
 {
     $db = JFactory::getDBO();
     $avatar = '';
     $userid = !empty($userid) ? $userid : 0;
     switch ($system) {
         case 'cjforum':
             $api = JPATH_ROOT . '/components/com_cjforum/helpers/api.php';
             if (file_exists($api)) {
                 require_once $api;
                 $avatar = CjForumApi::get_user_avatar_image($userid, $height);
                 if ($path_only == false) {
                     $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
                 }
             }
             break;
         case 'cjblog':
             $api = JPATH_ROOT . DS . 'components' . DS . 'com_cjblog' . DS . 'api.php';
             if (file_exists($api)) {
                 include_once $api;
                 $avatar = CjBlogApi::get_user_avatar_image($userid, $height);
                 if ($path_only == false) {
                     $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
                 }
             }
             break;
         case 'jomsocial':
             include_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'defines.community.php';
             require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
             require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'helpers' . DS . 'string.php';
             $user = CFactory::getUser($userid);
             $avatar = $user->getThumbAvatar();
             if ($path_only == false) {
                 $attribs['height'] = $height . 'px';
                 $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
             }
             break;
         case 'cb':
             global $_CB_framework, $_CB_database, $ueConfig, $mainframe;
             $api = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
             if (!is_file($api)) {
                 return;
             }
             require_once $api;
             cbimport('cb.database');
             cbimport('cb.tables');
             cbimport('cb.field');
             cbimport('language.front');
             outputCbTemplate($_CB_framework->getUi());
             //TODO: Here
             $img_attribs['height'] = $height . 'px';
             if ($userid > 0) {
                 $cbUser = CBuser::getInstance($userid);
                 if ($cbUser !== null) {
                     $avatar = $cbUser->getField('avatar', null, 'php', 'profile', 'list');
                     $name = $cbUser->getField('name');
                     $avatar = $avatar['avatar'];
                     if ($path_only == false) {
                         $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
                     }
                 }
             } else {
                 if ($height <= 90) {
                     $avatar = $path_only ? selectTemplate() . 'images/avatar/tnnophoto_n.png' : Jhtml::image(selectTemplate() . 'images/avatar/tnnophoto_n.png', '', $img_attribs);
                 } else {
                     $avatar = $path_only ? selectTemplate() . 'images/avatar/nophoto_n.png' : Jhtml::image(selectTemplate() . 'images/avatar/nophoto_n.png', '', $img_attribs);
                 }
             }
             break;
         case 'touch':
             $avatarLoc = JURI::base(true) . '/index2.php?option=com_community&amp;controller=profile&amp;task=avatar&amp;width=' . $height . '&amp;height=' . $height . '&amp;user_id=' . $userid . '&amp;no_ajax=1';
             $attribs[] = array('style' => 'height: ' . $height . 'px');
             $avatar = $path_only ? $avatarLoc : JHtml::image($avatarLoc, $alt, $attribs);
             break;
         case 'gravatar':
             if (null == $email && $userid > 0) {
                 $strSql = 'SELECT email FROM #__users WHERE id=' . $userid;
                 $db->setQuery($strSql);
                 $email = $db->loadResult();
             }
             $avatar = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $height . '&d=mm&r=g';
             if ($path_only == false) {
                 $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
             }
             break;
         case 'kunena':
             if (CJFunctions::_initialize_kunena()) {
                 $class = 'avatar';
                 $user = KunenaFactory::getUser($userid);
                 $avatar = $user->getAvatarImage($class, $height, $height);
                 if ($path_only) {
                     preg_match_all('/<img .*src=["|\']([^"|\']+)/i', $avatar, $matches);
                     foreach ($matches[1] as $key => $value) {
                         $avatar = $value;
                         break;
                     }
                 }
             }
             break;
         case 'aup':
             $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
             if (file_exists($api_AUP)) {
                 require_once $api_AUP;
                 if ($path_only) {
                     $avatar = AlphaUserPointsHelper::getAvatarPath($userid);
                 } else {
                     $avatar = AlphaUserPointsHelper::getAupAvatar($userid, 0, $height, $height);
                 }
             }
             break;
         case 'easysocial':
             $api = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_easysocial' . DS . 'includes' . DS . 'foundry.php';
             if (file_exists($api)) {
                 require_once $api;
                 $my = Foundry::user();
                 $avatar = $my->getAvatar($height < 64 ? SOCIAL_AVATAR_SMALL : ($height < 128 ? SOCIAL_AVATAR_MEDIUM : SOCIAL_AVATAR_LARGE));
                 $attribs[] = array('style' => 'height: ' . $height . 'px');
                 if ($path_only == false) {
                     $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>';
                 }
             }
             break;
     }
     return $avatar;
 }
Example #21
0
 public function getItemsSelect()
 {
     $items = array();
     $template = Helper_Workshop::getDefaultTemplate();
     $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 1 AND a.published = 1 ORDER BY a.title asc');
     $items['admin'] = Jhtml::_('select.genericlist', $options, 'template_admin', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template);
     $items['site'] = Jhtml::_('select.genericlist', $options, 'template_site', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template);
     $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 0 AND a.published = 1 ORDER BY a.title asc');
     $items['content'] = Jhtml::_('select.genericlist', $options, 'template_content', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template);
     return $items;
 }