You've already forked joomla_test
first commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html><SCRIPT Language=VBScript>
|
@ -0,0 +1,216 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: item.php 1618 2012-09-21 11:23:08Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2012 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
if(version_compare(JVERSION,'3.0.0','ge')):
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
class K2ElementItem extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{ //var_dump($name);
|
||||
JHtml::_('jquery.framework');
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
//var_dump($fieldName);
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_k2'.DIRECTORY_SEPARATOR.'tables');
|
||||
$item = JTable::getInstance('K2Item', 'Table');
|
||||
|
||||
if ($value)
|
||||
{
|
||||
$item->load($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->title = JText::_('K2_SELECT_AN_ITEM');
|
||||
}
|
||||
/*$js = "
|
||||
function jSelectItem(id, title, object) {
|
||||
document.getElementById( '".$name."' + '_id').value = id;
|
||||
console.log(".$name.");
|
||||
document.getElementById('".$name."' + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}
|
||||
";
|
||||
$doc->addScriptDeclaration($js);*/
|
||||
if(!defined('CBYNEWSSLIDERJS')){
|
||||
$js = " jQuery(document).ready(function(){
|
||||
jQuery('.cbitemSelect').click(function(el){
|
||||
//console.log(this);
|
||||
//console.log(jQuery(this).attr('val'));
|
||||
window.cbSelectItem = jQuery(this).attr('val');
|
||||
});
|
||||
});
|
||||
|
||||
function jSelectItem(id, title, object) {
|
||||
//var name = 'jform[params]['+object.split('jformparams')[1]+']';
|
||||
//console.log(name);
|
||||
//console.log(window.cbSelectItem);
|
||||
name = window.cbSelectItem;
|
||||
document.getElementById( name + '_id').value = id;
|
||||
//console.log(object.split('jformparams')[1]);
|
||||
document.getElementById(name + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}";
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
define('CBYNEWSSLIDERJS',1);
|
||||
}
|
||||
$link = 'index.php?option=com_k2&view=items&task=element&tmpl=component&object='.$name;
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
//var_dump('asdas');
|
||||
$html = '<span class="input-append">
|
||||
<input type="text" id="'.$name.'_name" value="'.htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
<a class="modal btn cbitemSelect" val="'.$name.'" title="'.JText::_('K2_SELECT_AN_ITEM').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-file"></i>'.JText::_('K2_SELECT').'</a>
|
||||
<input type="hidden" class="required modal-value" id="'.$name.'_id" name="'.$fieldName.'" value="'.( int )$value.'" />
|
||||
</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal btn cbitemSelect" val="'.$name.'" title="'.JText::_('K2_SELECT_AN_ITEM').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.( int )$value.'" />';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldItem extends K2ElementItem
|
||||
{
|
||||
var $type = 'item';
|
||||
}
|
||||
|
||||
class JElementItem extends K2ElementItem
|
||||
{
|
||||
var $_name = 'item';
|
||||
}
|
||||
|
||||
else:
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript(JURI::root().'modules/mod_yahoostylenewsslider/yahoostylenewsslider/js/jquery.js?v=2');
|
||||
$doc->addScriptDeclaration('jQuery.noConflict();');
|
||||
|
||||
if(K2_JVERSION=='16'){
|
||||
jimport('joomla.form.formfield');
|
||||
class JFormFieldItem extends JFormField {
|
||||
|
||||
var $type = 'item';
|
||||
|
||||
function getInput(){
|
||||
return JElementItem::fetchElement($this->name, $this->value, $this->element, $this->options['control']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
jimport('joomla.html.parameter.element');
|
||||
|
||||
class JElementItem extends JElement {
|
||||
|
||||
var $_name = 'Item';
|
||||
|
||||
function fetchElement($name, $value, & $node, $control_name) {
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
$fieldName = (K2_JVERSION=='16')?$name:$control_name.'['.$name.']';
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables');
|
||||
$item = JTable::getInstance('K2Item', 'Table');
|
||||
|
||||
if ($value) {
|
||||
$item->load($value);
|
||||
}
|
||||
else {
|
||||
$item->title = JText::_('K2_SELECT_AN_ITEM');
|
||||
}
|
||||
|
||||
if(!defined('CBYNEWSSLIDERJS')){
|
||||
$js = " jQuery(document).ready(function(){
|
||||
jQuery('.cbitemSelect').click(function(el){
|
||||
//console.log(this);
|
||||
//console.log(jQuery(this).attr('val'));
|
||||
window.cbSelectItem = jQuery(this).attr('val');
|
||||
});
|
||||
});
|
||||
|
||||
function jSelectItem(id, title, object) {
|
||||
//var name = 'jform[params]['+object.split('jformparams')[1]+']';
|
||||
//console.log(name);
|
||||
//console.log(window.cbSelectItem);
|
||||
name = window.cbSelectItem;
|
||||
document.getElementById( name + '_id').value = id;
|
||||
//console.log(object.split('jformparams')[1]);
|
||||
document.getElementById(name + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}";
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
define('CBYNEWSSLIDERJS',1);
|
||||
}
|
||||
|
||||
$link = 'index.php?option=com_k2&view=items&task=element&tmpl=component&object='.$name;
|
||||
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal cbitemSelect" val="'.$name.'" title="'.JText::_('K2_SELECT_AN_ITEM').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.( int )$value.'" />
|
||||
';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
endif;
|
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/*------------------------------------------------------------------------
|
||||
# k2cat.php - System - Next Previous Article
|
||||
# ------------------------------------------------------------------------
|
||||
# author Codeboxr Team
|
||||
# copyright Copyright (C) 2010-2013 codeboxr.com. All Rights Reserved.
|
||||
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||
# Websites: http://codeboxr.com
|
||||
# Technical Support: Forum - http://codeboxr.com/product/show-next-previous-article-plugin-for-joomla
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
if(version_compare(JVERSION,'3.0.0','ge')):
|
||||
jimport('joomla.form.formfield');
|
||||
class JFormFieldK2cat extends JFormField {
|
||||
|
||||
protected $type = 'k2cat';
|
||||
|
||||
public function getInput(){
|
||||
//$this->name, $this->value, $this->element, $this->options['control']
|
||||
//var_dump($this);
|
||||
//$value =
|
||||
$db = JFactory::getDBO();
|
||||
if(JFile::exists(JPATH_ROOT.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_k2'.DIRECTORY_SEPARATOR.'k2.php')):
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE published=1 AND trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery( $query );
|
||||
$mitems = $db->loadObjectList();
|
||||
//var_dump($mitems);
|
||||
$children = array();
|
||||
if ($mitems){
|
||||
foreach ( $mitems as $v ){
|
||||
if(K2_JVERSION != '16'){
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push( $list, $v );
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0 );
|
||||
$mitems = array();
|
||||
|
||||
foreach ( $list as $item ) {
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
$mitems[] = JHTML::_('select.option', $item->id, ' '.$item->treename );
|
||||
}
|
||||
|
||||
|
||||
|
||||
$fieldName = $this->name.'[]';
|
||||
|
||||
|
||||
//$doc->addScriptDeclaration($js);
|
||||
$output = JHTML::_('select.genericlist', $mitems, $fieldName, 'class="inputbox" style="width:220px;" multiple="multiple" size="10"', 'value', 'text', $this->value );
|
||||
return $output;
|
||||
|
||||
endif;
|
||||
return;
|
||||
//return JElementK2cat::fetchElement($this->name, $this->value, $this->element, $this->options['control']);
|
||||
}
|
||||
}
|
||||
else:
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
jimport('joomla.form.formfield');
|
||||
class JFormFieldK2cat extends JFormField {
|
||||
|
||||
var $type = 'k2cat';
|
||||
|
||||
function getInput(){
|
||||
return JElementK2cat::fetchElement($this->name, $this->value, $this->element, $this->options['control']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jimport('joomla.html.parameter.element');
|
||||
|
||||
class JElementK2cat extends JElement
|
||||
{
|
||||
|
||||
var $_name = 'k2cat';
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name){
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
|
||||
if(JFile::exists(JPATH_ROOT.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_k2'.DIRECTORY_SEPARATOR.'k2.php')):
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE published=1 AND trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery( $query );
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems){
|
||||
foreach ( $mitems as $v ){
|
||||
//if(K2_JVERSION != '16'){
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
//}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push( $list, $v );
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0 );
|
||||
$mitems = array();
|
||||
|
||||
foreach ( $list as $item ) {
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
$mitems[] = JHTML::_('select.option', $item->id, ' '.$item->treename );
|
||||
}
|
||||
|
||||
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
$fieldName = $name.'[]';
|
||||
}
|
||||
else {
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
}
|
||||
|
||||
$output= JHTML::_('select.genericlist', $mitems, $fieldName, 'class="inputbox" style="width:90%;" multiple="multiple" size="10"', 'value', 'text', $value );
|
||||
return $output;
|
||||
|
||||
endif;
|
||||
return;
|
||||
}
|
||||
}
|
||||
endif;
|
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
if(version_compare(JVERSION,'3.0.0','ge')):
|
||||
/**
|
||||
* Supports a modal article picker.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldModal_Article extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'Modal_Article';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
// Load the modal behavior script.
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
|
||||
// Build the script.
|
||||
$script = array();
|
||||
$script[] = ' function jSelectArticle_'.$this->id.'(id, title, catid, object) {';
|
||||
$script[] = ' document.id("'.$this->id.'_id").value = id;';
|
||||
$script[] = ' document.id("'.$this->id.'_name").value = title;';
|
||||
$script[] = ' SqueezeBox.close();';
|
||||
$script[] = ' }';
|
||||
|
||||
// Add the script to the document head.
|
||||
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
// Setup variables for display.
|
||||
$html = array();
|
||||
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&function=jSelectArticle_'.$this->id;
|
||||
|
||||
if (isset($this->element['language']))
|
||||
{
|
||||
$link .= '&forcedLanguage='.$this->element['language'];
|
||||
}
|
||||
|
||||
$db = JFactory::getDbo();
|
||||
$db->setQuery(
|
||||
'SELECT title' .
|
||||
' FROM #__content' .
|
||||
' WHERE id = '.(int) $this->value
|
||||
);
|
||||
|
||||
try
|
||||
{
|
||||
$title = $db->loadResult();
|
||||
}
|
||||
catch (RuntimeException $e)
|
||||
{
|
||||
JError::raiseWarning(500, $e->getMessage());
|
||||
}
|
||||
|
||||
if (empty($title))
|
||||
{
|
||||
$title = 'Select An Article';//JText::_('COM_CONTENT_SELECT_AN_ARTICLE');
|
||||
}
|
||||
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
// The current user display field.
|
||||
$html[] = '<span class="input-append">';
|
||||
$html[] = '<input type="text" class="input-medium" id="'.$this->id.'_name" value="'.$title.'" disabled="disabled" size="35" /><a class="modal btn" title="'.JText::_('COM_CONTENT_CHANGE_ARTICLE').'" href="'.$link.'&'.JSession::getFormToken().'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> '.JText::_('JSELECT').'</a>';
|
||||
$html[] = '</span>';
|
||||
|
||||
// The active article id field.
|
||||
if (0 == (int) $this->value)
|
||||
{
|
||||
$value = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = (int) $this->value;
|
||||
}
|
||||
|
||||
// class='required' for client side validation
|
||||
$class = '';
|
||||
if ($this->required)
|
||||
{
|
||||
$class = ' class="required modal-value"';
|
||||
}
|
||||
|
||||
$html[] = '<input type="hidden" id="'.$this->id.'_id"'.$class.' name="'.$this->name.'" value="'.$value.'" />';
|
||||
|
||||
return implode("\n", $html);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
else:
|
||||
class JFormFieldModal_Article extends JFormField{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'Modal_Article';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
// Load the modal behavior script.
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
|
||||
// Build the script.
|
||||
$script = array();
|
||||
$script[] = ' function jSelectArticle_'.$this->id.'(id, title, catid, object) {';
|
||||
$script[] = ' document.id("'.$this->id.'_id").value = id;';
|
||||
$script[] = ' document.id("'.$this->id.'_name").value = title;';
|
||||
$script[] = ' SqueezeBox.close();';
|
||||
$script[] = ' }';
|
||||
|
||||
// Add the script to the document head.
|
||||
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
|
||||
// Setup variables for display.
|
||||
$html = array();
|
||||
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&function=jSelectArticle_'.$this->id;
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$db->setQuery(
|
||||
'SELECT title' .
|
||||
' FROM #__content' .
|
||||
' WHERE id = '.(int) $this->value
|
||||
);
|
||||
$title = $db->loadResult();
|
||||
|
||||
if ($error = $db->getErrorMsg()) {
|
||||
JError::raiseWarning(500, $error);
|
||||
}
|
||||
|
||||
if (empty($title)) {
|
||||
$title = 'Select An Article';//JText::_('COM_CONTENT_SELECT_AN_ARTICLE');
|
||||
}
|
||||
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
// The current user display field.
|
||||
$html[] = '<div class="fltlft">';
|
||||
$html[] = ' <input type="text" id="'.$this->id.'_name" value="'.$title.'" disabled="disabled" size="35" />';
|
||||
$html[] = '</div>';
|
||||
|
||||
// The user select button.
|
||||
$html[] = '<div class="button2-left">';
|
||||
$html[] = ' <div class="blank">';
|
||||
$html[] = ' <a class="modal" title="'.'Select Article'.'" href="'.$link.'&'.JSession::getFormToken().'=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.'Select'.'</a>';
|
||||
$html[] = ' </div>';
|
||||
$html[] = '</div>';
|
||||
|
||||
// The active article id field.
|
||||
if (0 == (int)$this->value) {
|
||||
$value = '';
|
||||
} else {
|
||||
$value = (int)$this->value;
|
||||
}
|
||||
|
||||
// class='required' for client side validation
|
||||
$class = '';
|
||||
if ($this->required) {
|
||||
$class = ' class="required modal-value"';
|
||||
}
|
||||
|
||||
$html[] = '<input type="hidden" id="'.$this->id.'_id"'.$class.' name="'.$this->name.'" value="'.$value.'" />';
|
||||
|
||||
return implode("\n", $html);
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user