feat(deployed): add Jumi 3.0.5 (no-source, vetted live)
Jumi (Edvard Ananyan); business closed, no clean J3 upstream -> deployed files. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
This commit is contained in:
parent
62e29d6343
commit
1097812b20
@ -0,0 +1,58 @@
|
|||||||
|
/**
|
||||||
|
* @version $Id: icons.css 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
**/
|
||||||
|
.icon-48-showapplications { background-image: url("../images/icon-48-showapplications.png"); }
|
||||||
|
.icon-48-manage { background-image: url("../images/icon-48-showapplications.png"); }
|
||||||
|
|
||||||
|
.jumi_bottom_icon {
|
||||||
|
width: 32px;
|
||||||
|
height: 33px;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin: 0 6px 0 6px;
|
||||||
|
text-decoration: none !important;
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jumi_rate {
|
||||||
|
background:transparent url("../images/star.png") left 1px no-repeat;
|
||||||
|
}
|
||||||
|
#jumi_rate:HOVER {
|
||||||
|
background-position: left top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jumi_developer {
|
||||||
|
background:transparent url("../images/2glux.png") left 1px no-repeat;
|
||||||
|
}
|
||||||
|
#jumi_developer:HOVER {
|
||||||
|
background-position: left top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jumi_support {
|
||||||
|
background:transparent url("../images/support.png") left 1px no-repeat;
|
||||||
|
}
|
||||||
|
#jumi_support:HOVER {
|
||||||
|
background-position: left -32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jumi_homepage {
|
||||||
|
background:transparent url("../images/jumi.png") left 1px no-repeat;
|
||||||
|
}
|
||||||
|
#jumi_homepage:HOVER {
|
||||||
|
background-position: left top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#jumi_td {
|
||||||
|
box-shadow: inset 0 0 12px 0 rgba(201, 201, 201, 0.5);border: 1px solid #D6D6D6;border-radius: 6px;height: 40px;position: relative;
|
||||||
|
}
|
||||||
|
#jumi_td:hover {
|
||||||
|
box-shadow: inset 0 0 16px 0 rgba(201, 201, 201, 0.79);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination {
|
||||||
|
height: 10px !important;
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body style="background-color: #000;"></body></html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@ -0,0 +1 @@
|
|||||||
|
<html><body style="background-color: #000;"></body></html>
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: controller.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexypolling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
* Sexy Polling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport( 'joomla.application.component.controller' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jumi Controller
|
||||||
|
*
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage com_jumi
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiController extends JController {
|
||||||
|
function display($cachable = false, $urlparams = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
addSub( 'Application Manager', 'showapplications');
|
||||||
|
|
||||||
|
//Set the default view, just in case
|
||||||
|
$view = JRequest::getCmd('view');
|
||||||
|
if(empty($view)) {
|
||||||
|
JRequest::setVar('view', 'showApplications');
|
||||||
|
};
|
||||||
|
|
||||||
|
parent::display();
|
||||||
|
}// function
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiController extends JControllerLegacy{
|
||||||
|
function display($cachable = false, $urlparams = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
addSub( 'Application Manager', 'showapplications');
|
||||||
|
|
||||||
|
//Set the default view, just in case
|
||||||
|
$view = JRequest::getCmd('view');
|
||||||
|
if(empty($view)) {
|
||||||
|
JRequest::setVar('view', 'showApplications');
|
||||||
|
};
|
||||||
|
|
||||||
|
parent::display();
|
||||||
|
}// function
|
||||||
|
};
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: answers.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
* Sexy Polling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport( 'joomla.application.component.controller' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sexy_polling Controller
|
||||||
|
*
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
*/
|
||||||
|
class JumiControllerapplication extends JumiController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor (registers additional tasks to methods)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
// Register Extra tasks
|
||||||
|
$this->registerTask( 'add' , 'edit' );
|
||||||
|
$this->registerTask( 'unpublish', 'publish');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* display the edit form
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function edit()
|
||||||
|
{
|
||||||
|
JRequest::setVar( 'view', 'editapplication' );
|
||||||
|
JRequest::setVar('hidemainmenu', 1);
|
||||||
|
|
||||||
|
parent::display();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* save a record (and redirect to main page)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function save()
|
||||||
|
{
|
||||||
|
$model = $this->getModel('editapplication');
|
||||||
|
|
||||||
|
if ($model->store()) {
|
||||||
|
$msg = JText::_( 'Application Saved' );
|
||||||
|
} else {
|
||||||
|
$msg = JText::_( 'Error Saving Application' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the table in so it can be edited.... we are done with it anyway
|
||||||
|
$link = 'index.php?option=com_jumi';
|
||||||
|
$this->setRedirect($link, $msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* save a record (and redirect to main page)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function apply()
|
||||||
|
{
|
||||||
|
$model = $this->getModel('editapplication');
|
||||||
|
|
||||||
|
if ($model->store()) {
|
||||||
|
$msg = JText::_( 'Changes to Application saved' );
|
||||||
|
} else {
|
||||||
|
$msg = JText::_( 'Error Saving Application' );
|
||||||
|
}
|
||||||
|
$array = JRequest::getVar('cid', 0, '', 'array');
|
||||||
|
$id = (int)$array[0];
|
||||||
|
$this->setRedirect( 'index.php?option=com_jumi&controller=application&task=edit&cid[]=' . $id, $msg );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* publish a record (and redirect to main page)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function publish()
|
||||||
|
{
|
||||||
|
$publish = ( $this->getTask() == 'publish' ? 1 : 0 );
|
||||||
|
$model = $this->getModel('editapplication');
|
||||||
|
if(!$model->publish($publish)) {
|
||||||
|
$msg = JText::_( 'Error: One or More Applications Could not be Published/Unbublished' );
|
||||||
|
} else {
|
||||||
|
$msg = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setRedirect( 'index.php?option=com_jumi', $msg );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* remove record(s)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function remove()
|
||||||
|
{
|
||||||
|
$model = $this->getModel('editapplication');
|
||||||
|
if(!$model->delete()) {
|
||||||
|
$msg = JText::_( 'Error: One or More Applications Could not be Deleted' );
|
||||||
|
} else {
|
||||||
|
$msg = JText::_( 'Application(s) Deleted' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setRedirect( 'index.php?option=com_jumi', $msg );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cancel editing a record
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function cancel()
|
||||||
|
{
|
||||||
|
$msg = JText::_( 'Operation Cancelled' );
|
||||||
|
$this->setRedirect( 'index.php?option=com_jumi', $msg );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body style="background-color: #000;"></body></html>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
BIN
deployed/jumi/administrator/components/com_jumi/images/jumi.png
Normal file
BIN
deployed/jumi/administrator/components/com_jumi/images/jumi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 527 B |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS `#__jumi` (
|
||||||
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
|
`title` varchar(255) NOT NULL,
|
||||||
|
`alias` varchar(255) NOT NULL,
|
||||||
|
`path` varchar(255) default NULL,
|
||||||
|
`custom_script` text,
|
||||||
|
`access` int(11) unsigned NOT NULL default '0',
|
||||||
|
`checked_out` int(11) NOT NULL default '0',
|
||||||
|
`published` int(11) NOT NULL default '1',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `id` (`id`)
|
||||||
|
) ENGINE=MyISAM CHARACTER SET = `utf8`;
|
||||||
|
|
||||||
|
INSERT IGNORE INTO `#__jumi` VALUES (1, 'Hello Jumi!', 'hello-jumi', '', '<!-- Jumi intro including some php code (sitename, username) - see below. -->\r\n\r\n<?php\r\nfunction sitename() { //gets sitename\r\n $config = new JConfig();\r\n return $config->sitename;\r\n}\r\n$user = JFactory::getUser(); //gets user object\r\n?>\r\n\r\n<h3>Hello in the world of Jumi!</h3>\r\n<p>Jumi is a set of Joomla! extensions enabling to include custom codes (html, php, css, js, ...) into Joomla!</p>\r\n<ul>\r\n<li>Jumi <b>module</b> includes codes into Joomla! module positions,</li>\r\n<li>Jumi <b>plugin</b> includes codes into Joomla! articles,</li>\r\n<li>Jumi <b>component</b> creates separate Joomla! components from custom codes.</li>\r\n</ul>\r\n<p>We hope Jumi will be useful for your <strong><?php echo sitename(); ?></strong> site. As it is for more then 400.000 other webmasters and developers.<p>\r\n<h4>Jumi resources</h4>\r\n<p>You can also visit following resources for Jumi native extensions for Joomla! 1.5.x, 2.5.x ans 3.0.x:</p>\r\n<ul>\r\n<li><a href="http://2glux.com/projects/jumi" title="Jumi downloads">Jumi downloads</a>,</li>\r\n<li><a href="http://2glux.com/projects/jumi/concise-guide" title="Concise guide">Jumi concise guide</a>,</li>\r\n<li><a href="http://2glux.com/projects/jumi/tutorial" title="Jumi Tips, tricks, snippet">Jumi tips, tricks and snippets</a>,</li>\r\n<li>Jumi support can be found at <a href="http://2glux.com/forum/jumi/" title="Jumi support">Jumi support forum</a>,</li>\r\n<li><a href="http://extensions.joomla.org/extensions/edition/custom-code-in-content/1023/" title="Jumi feedbacks and opinions">Jumi feedbacks and opinions</a>.</li>\r\n</ul>\r\n<p>Dear \r\n<?php\r\nif ($user->name == '''')\r\n echo "unknown, not logged, friend";\r\nelse\r\n echo $user->name;\r\n?>\r\n!<br />Have a nice day, weeks, months and years with Jumi!\r\n<br />\r\nWhat next? Try <a href="index.php?option=com_jumi&fileid=2">Joomla!-Jumi blogspot component</a> in your pages now!\r\n</p>', 0, 0, 1);
|
||||||
|
INSERT IGNORE INTO `#__jumi` VALUES (2, 'Blogspot', 'blogspot', 'components/com_jumi/files/blogger.php', '<?php\r\n//Display joomla-jumi.blogspot.com\r\n//You can change following variables so you can display your own blog.\r\n$blogId = ''1748567850225926498'';\r\n$login = ''joomla-jumi'';\r\n$cacheTime = 86400;\r\n?>', 0, 0, 1);
|
||||||
63
deployed/jumi/administrator/components/com_jumi/jumi.php
Normal file
63
deployed/jumi/administrator/components/com_jumi/jumi.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define constants for all pages
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!defined('DS')){
|
||||||
|
define('DS',DIRECTORY_SEPARATOR);
|
||||||
|
}
|
||||||
|
define('JV', (version_compare(JVERSION, '3', 'l')) ? 'j2' : 'j3');
|
||||||
|
define( 'COM_JUMI_DIR', 'images'.DS.'jumi'.DS );
|
||||||
|
define( 'COM_JUMI_BASE', JPATH_ROOT.DS.COM_JUMI_DIR );
|
||||||
|
define( 'COM_JUMI_BASEURL', JURI::root().str_replace( DS, '/', COM_JUMI_DIR ));
|
||||||
|
|
||||||
|
require_once( JPATH_COMPONENT.DS.'controller.php' );
|
||||||
|
|
||||||
|
// Require specific controller if requested
|
||||||
|
if($controller = JRequest::getWord('controller')) {
|
||||||
|
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
|
||||||
|
if (file_exists($path)) {
|
||||||
|
require_once $path;
|
||||||
|
} else {
|
||||||
|
$controller = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the controller
|
||||||
|
$classname = 'JumiController'.$controller;
|
||||||
|
$controller = new $classname( );
|
||||||
|
|
||||||
|
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
|
||||||
|
$cssFile = JURI::base(true).'/components/com_jumi/assets/css/icons.css';
|
||||||
|
$document->addStyleSheet($cssFile, 'text/css', null, array());
|
||||||
|
|
||||||
|
// Perform the Request task
|
||||||
|
$controller->execute( JRequest::getCmd('task'));
|
||||||
|
$controller->redirect();
|
||||||
|
|
||||||
|
function addSub($title, $v, $controller = null, $image = null) {
|
||||||
|
|
||||||
|
$enabled = false;
|
||||||
|
$view = JRequest::getWord("view", 'showapplications');
|
||||||
|
if($view == $v) {
|
||||||
|
$img = $v;
|
||||||
|
if($image != null) $img = $image;
|
||||||
|
JToolBarHelper::title(( 'Jumi' ) .' - '. JText::_( $title), $img.'.png' );
|
||||||
|
$enabled = true;
|
||||||
|
}
|
||||||
|
$link = 'index.php?option=com_jumi&view='.$v;
|
||||||
|
if($controller != null) $link .= '&controller='.$controller;
|
||||||
|
JSubMenuHelper::addEntry( JText::_($title), $link, $enabled);
|
||||||
|
|
||||||
|
}
|
||||||
71
deployed/jumi/administrator/components/com_jumi/jumi.xml
Normal file
71
deployed/jumi/administrator/components/com_jumi/jumi.xml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="component" version="2.5" method="upgrade">
|
||||||
|
<name>com_jumi</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (c) 2008 - 2015 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||||
|
<authorEmail>info@2glux.com</authorEmail>
|
||||||
|
<authorUrl>http://2glux.com/</authorUrl>
|
||||||
|
<version>3.0.5</version>
|
||||||
|
<description><![CDATA[This component includes custom scripts (html, php, js, css, ...) into Joomla! pages.<br />Collaboration between multiple Joomla! pages and other Jumi extensions is easy.<br />For Jumi downloads and guides visit <a href="http://2glux.com/projects/jumi" target="_blank">http://2glux.com/projects/jumi</a><br />For Jumi demos, tips and tricks visit <a href="http://2glux.com/projects/jumi/tutorial" target="_blank">http://2glux.com/projects/jumi/tutorial</a>]]></description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename>jumi.php</filename>
|
||||||
|
<filename>controller.php</filename>
|
||||||
|
<filename>router.php</filename>
|
||||||
|
<filename>index.html</filename>
|
||||||
|
<filename>release_notes.txt</filename>
|
||||||
|
<folder>files</folder>
|
||||||
|
<folder>views</folder>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<scriptfile>scriptfile.php</scriptfile>
|
||||||
|
|
||||||
|
<install>
|
||||||
|
<sql>
|
||||||
|
<file driver="mysql" charset="utf8">install.jumi.sql</file>
|
||||||
|
</sql>
|
||||||
|
</install>
|
||||||
|
|
||||||
|
<uninstall>
|
||||||
|
<sql>
|
||||||
|
<file driver="mysql" charset="utf8">uninstall.jumi.sql</file>
|
||||||
|
</sql>
|
||||||
|
</uninstall>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<linkparts name="fileid" type="sql" default="1" label="FILE" query="SELECT id, title FROM #__jumi" key_field="id" value_field="title" description="PARAMFILE" />
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<administration>
|
||||||
|
<menu img="components/com_jumi/images/jumi.png">COM_JUMI_MENU</menu>
|
||||||
|
<files folder="admin">
|
||||||
|
<filename>jumi.php</filename>
|
||||||
|
<filename>controller.php</filename>
|
||||||
|
<filename>install.jumi.sql</filename>
|
||||||
|
<filename>uninstall.jumi.sql</filename>
|
||||||
|
<filename>index.html</filename>
|
||||||
|
<folder>images</folder>
|
||||||
|
<folder>assets</folder>
|
||||||
|
<folder>module</folder>
|
||||||
|
<folder>plugin</folder>
|
||||||
|
<folder>router</folder>
|
||||||
|
<folder>views</folder>
|
||||||
|
<folder>models</folder>
|
||||||
|
<folder>controllers</folder>
|
||||||
|
</files>
|
||||||
|
<languages folder="admin/language">
|
||||||
|
<language tag="en-GB">en-GB/en-GB.com_jumi.ini</language>
|
||||||
|
<language tag="en-GB">en-GB/en-GB.com_jumi.sys.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.com_jumi.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.com_jumi.sys.ini</language>
|
||||||
|
<language tag="cs-CZ">cs_CZ/cs-CZ.com_jumi.ini</language>
|
||||||
|
<language tag="cs-CZ">cs_CZ/cs-CZ.com_jumi.sys.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.com_jumi.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.com_jumi.sys.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.com_jumi.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.com_jumi.sys.ini</language>
|
||||||
|
</languages>
|
||||||
|
</administration>
|
||||||
|
</extension>
|
||||||
@ -0,0 +1,283 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: manageanswers.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
* Sexy Polling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import Joomla! libraries
|
||||||
|
jimport('joomla.application.component.model');
|
||||||
|
jimport( 'joomla.utilities.date' );
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiModeleditApplication extends JModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor that retrieves the ID from the request
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$array = JRequest::getVar('cid', 0, '', 'array');
|
||||||
|
$this->setId((int)$array[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to set the hello identifier
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param int Hello identifier
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function setId($id)
|
||||||
|
{
|
||||||
|
// Set id and wipe data
|
||||||
|
$this->_id = $id;
|
||||||
|
$this->_data = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get a data
|
||||||
|
* @return object with data
|
||||||
|
*/
|
||||||
|
function &getData()
|
||||||
|
{
|
||||||
|
// Load the data
|
||||||
|
if (empty( $this->_data )) {
|
||||||
|
$query = 'SELECT * FROM #__jumi WHERE id = '.$this->_id;
|
||||||
|
$this->_db->setQuery( $query );
|
||||||
|
$this->_data = $this->_db->loadObject();
|
||||||
|
}
|
||||||
|
if (!$this->_data) {
|
||||||
|
$this->_data = new stdClass();
|
||||||
|
$this->_data->id = 0;
|
||||||
|
$this->_data->name = null;
|
||||||
|
}
|
||||||
|
JFilterOutput::objectHTMLSafe($this->_data,ENT_QUOTES);
|
||||||
|
return $this->_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to store a record
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function store()
|
||||||
|
{
|
||||||
|
$array = JRequest::getVar('cid', 0, '', 'array');
|
||||||
|
$applid = (int)$array[0];
|
||||||
|
|
||||||
|
$title = $this->_db->Quote(JRequest::getString('title'));
|
||||||
|
$alias = $this->_db->Quote(JRequest::getString('alias'));
|
||||||
|
$custom_script = $this->_db->Quote(stripslashes($_POST['custom_script']));
|
||||||
|
$path = $this->_db->Quote(JRequest::getString('path'));
|
||||||
|
if($applid == 0) {
|
||||||
|
$query = "insert into #__jumi (title, alias, custom_script, path) values($title,$alias,$custom_script,$path)";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
if(!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
$query = "update #__jumi set title = $title, alias = $alias, custom_script = $custom_script, path = $path where id = $applid";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
if(!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete record(s)
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function delete()
|
||||||
|
{
|
||||||
|
$cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );
|
||||||
|
|
||||||
|
if (count( $cids )) {
|
||||||
|
foreach($cids AS $id) {
|
||||||
|
$query = "delete from #__jumi where id = $id";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
$this->_db->query();
|
||||||
|
if($this->_db->getErrorMsg())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete record(s)
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function publish($publish)
|
||||||
|
{
|
||||||
|
$cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );
|
||||||
|
JArrayHelper::toInteger($cids);
|
||||||
|
$cids_sql = implode(',',$cids);
|
||||||
|
|
||||||
|
if (count( $cids )) {
|
||||||
|
$query = "UPDATE #__jumi SET published = ".(int) $publish." WHERE id in ($cids_sql)";
|
||||||
|
$this->_db->setQuery( $query );
|
||||||
|
if (!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiModeleditApplication extends JModelLegacy {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor that retrieves the ID from the request
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$array = JRequest::getVar('cid', 0, '', 'array');
|
||||||
|
$this->setId((int)$array[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to set the hello identifier
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param int Hello identifier
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function setId($id)
|
||||||
|
{
|
||||||
|
// Set id and wipe data
|
||||||
|
$this->_id = $id;
|
||||||
|
$this->_data = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get a data
|
||||||
|
* @return object with data
|
||||||
|
*/
|
||||||
|
function &getData()
|
||||||
|
{
|
||||||
|
// Load the data
|
||||||
|
if (empty( $this->_data )) {
|
||||||
|
$query = 'SELECT * FROM #__jumi WHERE id = '.$this->_id;
|
||||||
|
$this->_db->setQuery( $query );
|
||||||
|
$this->_data = $this->_db->loadObject();
|
||||||
|
}
|
||||||
|
if (!$this->_data) {
|
||||||
|
$this->_data = new stdClass();
|
||||||
|
$this->_data->id = 0;
|
||||||
|
$this->_data->name = null;
|
||||||
|
}
|
||||||
|
JFilterOutput::objectHTMLSafe($this->_data,ENT_QUOTES);
|
||||||
|
return $this->_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to store a record
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function store()
|
||||||
|
{
|
||||||
|
$array = JRequest::getVar('cid', 0, '', 'array');
|
||||||
|
$applid = (int)$array[0];
|
||||||
|
|
||||||
|
$title = $this->_db->Quote(JRequest::getString('title'));
|
||||||
|
$alias = $this->_db->Quote(JRequest::getString('alias'));
|
||||||
|
$custom_script = $this->_db->Quote(stripslashes($_POST['custom_script']));
|
||||||
|
$path = $this->_db->Quote(JRequest::getString('path'));
|
||||||
|
if($applid == 0) {
|
||||||
|
$query = "insert into #__jumi (title, alias, custom_script, path) values($title,$alias,$custom_script,$path)";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
if(!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
$query = "update #__jumi set title = $title, alias = $alias, custom_script = $custom_script, path = $path where id = $applid";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
if(!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete record(s)
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function delete()
|
||||||
|
{
|
||||||
|
$cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );
|
||||||
|
|
||||||
|
if (count( $cids )) {
|
||||||
|
foreach($cids AS $id) {
|
||||||
|
$query = "delete from #__jumi where id = $id";
|
||||||
|
$this->_db->setQuery($query);
|
||||||
|
$this->_db->query();
|
||||||
|
if($this->_db->getErrorMsg())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete record(s)
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
function publish($publish) {
|
||||||
|
$cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );
|
||||||
|
JArrayHelper::toInteger($cids);
|
||||||
|
$cids_sql = implode(',',$cids);
|
||||||
|
|
||||||
|
if (count( $cids )) {
|
||||||
|
$query = "UPDATE #__jumi SET published = ".(int) $publish." WHERE id in ($cids_sql)";
|
||||||
|
$this->_db->setQuery( $query );
|
||||||
|
if (!$this->_db->query())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,255 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: sexyanswers.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
* Sexy Polling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import Joomla! libraries
|
||||||
|
jimport('joomla.application.component.model');
|
||||||
|
jimport( 'joomla.database.database' );
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiModelshowApplications extends JModel {
|
||||||
|
var $_data, $_total, $_pagination, $_filter;
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->loadFilter();
|
||||||
|
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
$option = 'com_jumi';
|
||||||
|
|
||||||
|
$this->_filter->filter_order = $mainframe->getUserStateFromRequest("$option.filter_order",'filter_order','m.id');
|
||||||
|
$this->_filter->filter_order_Dir = $mainframe->getUserStateFromRequest("$option.filter_order_Dir",'filter_order_Dir','');
|
||||||
|
$this->_filter->filter_state = $mainframe->getUserStateFromRequest("$option.filter_state",'filter_state','*');
|
||||||
|
$search = $mainframe->getUserStateFromRequest("$option.search",'search','');
|
||||||
|
$search = $this->_db->escape(trim(JString::strtolower($search)));
|
||||||
|
$this->_filter->search = $search;
|
||||||
|
|
||||||
|
if (!in_array($this->_filter->filter_order, array('m.title','m.path','m.published','g.name','m.id'))) {
|
||||||
|
$this->_filter->filter_order = 'm.id';
|
||||||
|
}
|
||||||
|
if (!in_array(strtoupper($this->_filter->filter_order_Dir), array('ASC', 'DESC'))) {
|
||||||
|
$this->_filter->filter_order_Dir = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//limits
|
||||||
|
$limit = $mainframe->getUserStateFromRequest( $option.'.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||||
|
$limitstart = $mainframe->getUserStateFromRequest( $option.JRequest::getCmd( 'view').'.limitstart', 'limitstart', 0, 'int' );
|
||||||
|
if($limitstart > $this->getTotal()) $limitstart = 0;
|
||||||
|
|
||||||
|
$this->setState('limit', $limit);
|
||||||
|
$this->setState('limitstart', $limitstart);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadFilter() {
|
||||||
|
$this->_filter = new JObject();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFilter() {
|
||||||
|
return $this->_filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the query
|
||||||
|
* @return string The query to be used to retrieve the rows from the database
|
||||||
|
*/
|
||||||
|
function _buildQuery() {
|
||||||
|
|
||||||
|
|
||||||
|
$where = array();
|
||||||
|
|
||||||
|
if( $this->_filter->filter_state )
|
||||||
|
{
|
||||||
|
if( $this->_filter->filter_state == 'P')
|
||||||
|
$where[] = 'm.published = 1';
|
||||||
|
elseif( $this->_filter->filter_state == 'U')
|
||||||
|
$where[] = 'm.published = 0';
|
||||||
|
}
|
||||||
|
if($this->_filter->search)
|
||||||
|
$where[] = 'LOWER(m.title) LIKE '.$this->_db->Quote( '%'.$this->_db->getEscaped( $this->_filter->search, true ).'%', false );
|
||||||
|
|
||||||
|
$where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
|
||||||
|
|
||||||
|
//create ordering
|
||||||
|
|
||||||
|
$orderby = ' ORDER BY '. $this->_filter->filter_order .' '. $this->_filter->filter_order_Dir;
|
||||||
|
|
||||||
|
$query = "SELECT m.* FROM #__jumi as m ";
|
||||||
|
|
||||||
|
$query_res = $query . $where . $orderby;
|
||||||
|
return $query_res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the hello data
|
||||||
|
* @return array Array of objects containing the data from the database
|
||||||
|
*/
|
||||||
|
function getData() {
|
||||||
|
// Lets load the data if it doesn't already exist
|
||||||
|
if (empty( $this->_data )) {
|
||||||
|
$query = $this->_buildQuery();
|
||||||
|
$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTotal()
|
||||||
|
{
|
||||||
|
//-- Load the content if it doesn't already exist
|
||||||
|
if(empty($this->_total))
|
||||||
|
{
|
||||||
|
$this->_total = $this->_getListCount($this->_buildQuery());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_total;
|
||||||
|
}//function
|
||||||
|
|
||||||
|
function getPagination()
|
||||||
|
{
|
||||||
|
//-- Load the content if it doesn't already exist
|
||||||
|
if(empty($this->_pagination))
|
||||||
|
{
|
||||||
|
jimport('joomla.html.pagination');
|
||||||
|
$this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_pagination;
|
||||||
|
}//function
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiModelshowApplications extends JModelLegacy {
|
||||||
|
var $_data, $_total, $_pagination, $_filter;
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->loadFilter();
|
||||||
|
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
$option = 'com_jumi';
|
||||||
|
|
||||||
|
$this->_filter->filter_order = $mainframe->getUserStateFromRequest("$option.filter_order",'filter_order','m.id');
|
||||||
|
$this->_filter->filter_order_Dir = $mainframe->getUserStateFromRequest("$option.filter_order_Dir",'filter_order_Dir','');
|
||||||
|
$this->_filter->filter_state = $mainframe->getUserStateFromRequest("$option.filter_state",'filter_state','*');
|
||||||
|
$search = $mainframe->getUserStateFromRequest("$option.search",'search','');
|
||||||
|
$search = $this->_db->escape(trim(JString::strtolower($search)));
|
||||||
|
$this->_filter->search = $search;
|
||||||
|
|
||||||
|
if (!in_array($this->_filter->filter_order, array('m.title','m.path','m.published','g.name','m.id'))) {
|
||||||
|
$this->_filter->filter_order = 'm.id';
|
||||||
|
}
|
||||||
|
if (!in_array(strtoupper($this->_filter->filter_order_Dir), array('ASC', 'DESC'))) {
|
||||||
|
$this->_filter->filter_order_Dir = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//limits
|
||||||
|
$limit = $mainframe->getUserStateFromRequest( $option.'.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||||
|
$limitstart = $mainframe->getUserStateFromRequest( $option.JRequest::getCmd( 'view').'.limitstart', 'limitstart', 0, 'int' );
|
||||||
|
if($limitstart > $this->getTotal()) $limitstart = 0;
|
||||||
|
|
||||||
|
$this->setState('limit', $limit);
|
||||||
|
$this->setState('limitstart', $limitstart);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadFilter() {
|
||||||
|
$this->_filter = new JObject();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFilter() {
|
||||||
|
return $this->_filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the query
|
||||||
|
* @return string The query to be used to retrieve the rows from the database
|
||||||
|
*/
|
||||||
|
function _buildQuery() {
|
||||||
|
|
||||||
|
|
||||||
|
$where = array();
|
||||||
|
|
||||||
|
if( $this->_filter->filter_state )
|
||||||
|
{
|
||||||
|
if( $this->_filter->filter_state == 'P')
|
||||||
|
$where[] = 'm.published = 1';
|
||||||
|
elseif( $this->_filter->filter_state == 'U')
|
||||||
|
$where[] = 'm.published = 0';
|
||||||
|
}
|
||||||
|
if($this->_filter->search)
|
||||||
|
$where[] = 'LOWER(m.title) LIKE '.$this->_db->Quote( '%'.$this->_db->escape( $this->_filter->search, true ).'%', false );
|
||||||
|
|
||||||
|
$where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
|
||||||
|
|
||||||
|
//create ordering
|
||||||
|
|
||||||
|
$orderby = ' ORDER BY '. $this->_filter->filter_order .' '. $this->_filter->filter_order_Dir;
|
||||||
|
|
||||||
|
$query = "SELECT m.* FROM #__jumi as m ";
|
||||||
|
|
||||||
|
$query_res = $query . $where . $orderby;
|
||||||
|
return $query_res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the hello data
|
||||||
|
* @return array Array of objects containing the data from the database
|
||||||
|
*/
|
||||||
|
function getData() {
|
||||||
|
// Lets load the data if it doesn't already exist
|
||||||
|
if (empty( $this->_data )) {
|
||||||
|
$query = $this->_buildQuery();
|
||||||
|
$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTotal()
|
||||||
|
{
|
||||||
|
//-- Load the content if it doesn't already exist
|
||||||
|
if(empty($this->_total))
|
||||||
|
{
|
||||||
|
$this->_total = $this->_getListCount($this->_buildQuery());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_total;
|
||||||
|
}//function
|
||||||
|
|
||||||
|
function getPagination()
|
||||||
|
{
|
||||||
|
//-- Load the content if it doesn't already exist
|
||||||
|
if(empty($this->_pagination))
|
||||||
|
{
|
||||||
|
jimport('joomla.html.pagination');
|
||||||
|
$this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_pagination;
|
||||||
|
}//function
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
|
||||||
|
|
||||||
|
class modJumiHelper {
|
||||||
|
function getCodeWritten(&$params) { //returns code written or ""
|
||||||
|
return trim($params->get( 'code_written' ));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStorageSource(&$params) { //returns filepathname or a record id or ""
|
||||||
|
$storage=trim($params->get('source_code_storage'));
|
||||||
|
if($storage!="") {
|
||||||
|
if($id = substr(strchr($storage,"*"),1)) { //if record id return it
|
||||||
|
return (int)$id;
|
||||||
|
}
|
||||||
|
else { // else return filepathname
|
||||||
|
return $params->def('default_absolute_path',JPATH_ROOT).DS.$storage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCodeStored($source) { //returns code stored in the database or null.
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
//$user = &JFactory::getUser();
|
||||||
|
//$database->setQuery("select custom_script from #__jumi where id = '{$source}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select custom_script from #__jumi where id = $source");
|
||||||
|
return $database->loadResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p><strong>Hello in the world of Jumi!</strong></p>
|
||||||
|
<p>This is the default Jumi demo file presented on <b><?php echo JURI::base(); ?></b>.</p>
|
||||||
|
<p>Jumi is a set of custom code extensions for CMS Joomla! Jumi comes as a component, a plugin and a module.</p>
|
||||||
|
<p>Jumi brings you sufficient power, flexibility and simplicity for quick development and reliable operation of your applications running under Joomla!</p>
|
||||||
|
<p>Jumi resources: <a href="http://edo.webmaster.am/jumi">Downloads & guides</a>, <a href="http://edo.webmaster.am/jumi/tutorial">Tips & tricks</a>.</p>
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
# $Id: cs-CZ.mod_jumi.ini 44 2008-12-02 13:32:16Z martin2hajek $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIMODULEDESC="<p>Tento modul vkládá na pozici moduluuživatelksý skript: manuálně nebo ze souboru nebo z databáze Jumi komponenty.<p>Existuje též kompatibilní Jumi plugin a komponenta.</p><p>Další zdroje: <a href="http://2glux.com/projects/jumi">Stahování a manuály</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tipy a triky</a>.</p>"
|
||||||
|
PARAMNOTES="Zde si můžete napsat své poznámky."
|
||||||
|
PARAMABSPATH="Volitelná Přednastavená Absolutní Cesta k souborům ke vložení. Používá se jako automatická předpona k zadané cestě. Pokud necháte pole prázdné, použije se kořenový adresář Joomla!. Na konci neuvádějte žádné lomítko."
|
||||||
|
PARAMCODEWRITTEN="Zde může být jakýkoliv skript. PHP skript musí mít počáteční a koncové php značky. Pokud chcete do uloženého skriptu přenést nějaké proměnné, nebo hodnoty, tak je můžete tady také definovat."
|
||||||
|
PARAMSOURCECODESTORAGE="Zdroj uloženého kódu. Může to být cesta k souboru nebo *ID, kde ID je číslo databázového záznamu Jumi komponenty."
|
||||||
|
PARAMMODULECACHING="Vyberte si, zda chcete mít cache obsahu modulu."
|
||||||
|
PARAMMODULECACHETIME="Čas, kdy se cache modulu bude pravidelně restaurovat."
|
||||||
|
ERROR_CONTENT="Jumi funguje, avšak<b>není, co ukázat</b>.<br />Vložte kód nebo uveďte jeho zdroj."
|
||||||
|
ERROR_FILE="Soubor <b>%s</b> neexistuje, nebo ej není možné přečíst!"
|
||||||
|
ERROR_RECORD="Záznam ID:<b>%d</b> neexistuje!"
|
||||||
|
CODEWRITTEN="Zapsaný kód"
|
||||||
|
DEFAULTABSOLUTEJUMIPATH="Přednastavená Absolutní Jumi Cesta"
|
||||||
|
NOTEPAD="Záznaník"
|
||||||
|
SOURCEOFCODE="Zdroj kódu"
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
# $Id: en-GB.mod_jumi.ini 42 2008-12-02 10:19:47Z edo888 $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
MOD_JUMI_DESC="<p>This module includes into a module position custom script: manually or from a file or from Jumi component database record.</p><p>There is also a compatible Jumi plugin and a component.</p><p>Additional resources: <a href="http://2glux.com/projects/jumi">Downloads & guides</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tutorial</a>.</p>"
|
||||||
|
PARAMNOTES="You can write your notes, reminders etc here."
|
||||||
|
PARAMABSPATH="Optional Default Absolute Path to the included file. It is prepend to filepathname to be included. If left blank then it is identical to Joomla! root directory. No slash at the end."
|
||||||
|
PARAMCODEWRITTEN="Can be any custom code. PHP script should have php start and end tags. If you need to pass values of variables into the code which source is defined below you can define them here too."
|
||||||
|
PARAMSOURCECODESTORAGE="Source of the stored code. Can be either the pathname of the file to be included or *id, where id is the record number of Jumi component database table."
|
||||||
|
PARAMMODULECACHING="Select whether to cache the content of this module."
|
||||||
|
PARAMMODULECACHETIME="The time before the module is recached."
|
||||||
|
ERROR_CONTENT="Jumi is working but there is <b>nothing to be shown</b>.<br />Write the code and/or specify the nonempty source of the code."
|
||||||
|
ERROR_FILE="File <b>%s</b> does not exist or is not readable!"
|
||||||
|
ERROR_RECORD="Record ID:<b>%d</b> does not exist!"
|
||||||
|
CODEWRITTEN="Code written"
|
||||||
|
DEFAULTABSOLUTEJUMIPATH="Default Absolute Jumi Path"
|
||||||
|
NOTEPAD="Notepad"
|
||||||
|
SOURCEOFCODE="Source of code"
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
# $Id: es-ES.mod_jumi.ini 48 2008-12-06 08:01:02Z edo888 $
|
||||||
|
# www.joomlanetprojects.com
|
||||||
|
# administracion@joomlanetprojects.com
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIMODULEDESC="<p>Este módulo incluye en una posición modular un script: manual, desde un archivo o desde la base de datos del componente Jumi.<p>También existen un plugin y un componente compatibles.</p><p>Recursos adicionales: <a href="http://2glux.com/projects/jumi">Descargas y Guias</a>, <a href="http://2glux.com/projects/jumi/tutorial">Trucos</a>.</p>"
|
||||||
|
PARAMNOTES="Puedes escribir tus notas, recordatorios, etc.."
|
||||||
|
PARAMABSPATH="Ruta absoluta opcional a los archivos a incluir. Si se deja en blanco será identica a la ruta absoluta del raíz de Joomla!. Sin barra al final."
|
||||||
|
PARAMCODEWRITTEN="Puede ser cualquier tipo de código. Los script php deben tener las etiquetas de php al principio y al final. Sí necesitas pasar valores o variables en el código fuente definido abajo puedes definirlas aqui también."
|
||||||
|
PARAMSOURCECODESTORAGE="Fuente del código guardado. Puede ser bien la ruta del archivo a incluir o la *id, donde id es el campo de la base de datos Jumi."
|
||||||
|
PARAMMODULECACHING="Selecciona como gestionar la caché del módulo."
|
||||||
|
PARAMMODULECACHETIME="Tiempo de la memoria caché."
|
||||||
|
ERROR_CONTENT="Jumi esta activo pero <b>no hay nada a mostrar</b>.<br />Escribe el código y/o especifica la fuente del código."
|
||||||
|
ERROR_FILE="El Archivo <b>%s</b> no existe o no tiene permisos de lectura!"
|
||||||
|
ERROR_RECORD="La ID:<b>%d</b> no existe en la base de datos!"
|
||||||
|
CODEWRITTEN="Editor de código"
|
||||||
|
DEFAULTABSOLUTEJUMIPATH="Ruta absoluta de Jumi por defecto"
|
||||||
|
NOTEPAD="Libreta"
|
||||||
|
SOURCEOFCODE="Código fuente"
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
# $Id: hy-AM.mod_jumi.ini 46 2008-12-04 13:16:17Z edo888 $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIMODULEDESC="<p>Այս մոդուլը ներբեռնում է սցենարներ մոդուլների տեղակայքերում:</p><p>Կան նաև համատեղ Jumi փլագին և քոմփոնենթ:</p><p>Հավելյալ տեղեկություններ. <a href="http://2glux.com/projects/jumi">Downloads & guides</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tips & tricks</a>.</p>"
|
||||||
|
PARAMNOTES="Դուք կարող եք այստեղ կատարել ձեր նշումները, հիշեցումները և այլն:"
|
||||||
|
PARAMABSPATH="Ոչ անհրաժեշտ Jumi-ի համր բացարձակ արահետը ֆայլը ներբեռնելու համար: Այն ավելացվում է ներբեռնվող ֆայլի արահետի սկզբում: Եթե նշված չէ, ապա համարժեք է Joomla!-ի արմատային պահոցին: Օգտագործեք առանց վերջում թեք նշանի:"
|
||||||
|
PARAMCODEWRITTEN="Կարող է լինել ցանկացած սցենար: PHP սցենարները պետք է ունենան նախաբան և վերջաբան: Եթե հարկավոր է սցենարին փոխանցել փոփոխականների արժեքներ, դուք կարող եք սահմանել դրանք այստեղ:"
|
||||||
|
PARAMSOURCECODESTORAGE="Պահպանվող սցենարի ակունքը: Կարող է լինել ֆայլի արահետ, որը պետք է ներբեռնել, կամ *id, որտեղ id-ն դա Jumi հավելվածի համարն է."
|
||||||
|
PARAMMODULECACHING="Ընտրեք քեշավորել արդյոք այս մոդուլի պարունակությունը"
|
||||||
|
PARAMMODULECACHETIME="Քեշավորման ժամկետը"
|
||||||
|
ERROR_CONTENT="Jumi-ն աշխատում է, բայց <b>չկա ոչինչ ցուցադրելու համար</b>:<br /> Գրեք սցենարը և/կամ նշեք ոչ դատարկ սցենարի ակունքը."
|
||||||
|
ERROR_FILE="<b>%s</b> ֆայլը գոյություն չունի կամ չի կարող կարդացվել!"
|
||||||
|
ERROR_RECORD="Գրառում ID:<b>%d</b>-ը գոյություն չունի!"
|
||||||
|
CODEWRITTEN="Խմբագրված կոդը"
|
||||||
|
DEFAULTABSOLUTEJUMIPATH="Jumi-ի համր բացարձակ արահետը"
|
||||||
|
NOTEPAD="Նոթատետր"
|
||||||
|
SOURCEOFCODE="Սցենարի ակունքները"
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
# $Id: ru-RU.mod_jumi.ini 42 2008-12-02 10:19:47Z edo888 $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIMODULEDESC="<p>Этот модуль включает пользовательский настраиваемый скрипт в позициях модулей вручную, из файла или из Jumi компоненты.</p><p>Существует также совместимые с модулем Jumi плагин и компонента.</p><p>Дополнительные ресурсы: <a href="http://2glux.com/projects/jumi">Дистрибутивы и инструкции</a>, <a href="http://2glux.com/projects/jumi/tutorial">Советы и хитрости</a>.</p>"
|
||||||
|
PARAMNOTES="Здесь вы можете записать ваши заметки, напоминаниями и т.д."
|
||||||
|
PARAMABSPATH="Не обязательный абсолютный путь для включаемого файла. Это ставится впереди пути файла, который должен быть включен. Если оставить пустым, то будет идентичен корневому каталогу Joomla. Используйте без / в конце."
|
||||||
|
PARAMCODEWRITTEN="Может быть любой пользовательский код. PHP скрипт должен иметь начальный и конечный теги. Если вам нужно передать значения переменных в код, вы можете задать их здесь."
|
||||||
|
PARAMSOURCECODESTORAGE="Источник храняемого кода. Может быть либо путь к файлу, который должен быть включен или *id, где id это номер приложения Jumi компоненты."
|
||||||
|
PARAMMODULECACHING="Выберите кэшировать ли содержание этого модуля."
|
||||||
|
PARAMMODULECACHETIME="Время кэширования."
|
||||||
|
ERROR_CONTENT="Jumi работает, но <b>нечего показывать</b>.<br />Введите код и/или укажите непустой код."
|
||||||
|
ERROR_FILE="Файл <b>%s</b> не существует или не является чтимым!"
|
||||||
|
ERROR_RECORD="Запись с ID:<b>%d</b> не существует!"
|
||||||
|
CODEWRITTEN="Записанный код"
|
||||||
|
DEFAULTABSOLUTEJUMIPATH="Абсолютный путь Jumi по умолчанию"
|
||||||
|
NOTEPAD="Блокнот"
|
||||||
|
SOURCEOFCODE="Источник кодов"
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
if(!defined('DS')){
|
||||||
|
define('DS',DIRECTORY_SEPARATOR);
|
||||||
|
}
|
||||||
|
// Include the functions only once
|
||||||
|
require_once(dirname(__FILE__).DS.'helper.php');
|
||||||
|
|
||||||
|
$code_written = modJumiHelper::getCodeWritten($params); //code written or ""
|
||||||
|
$storage_source = modJumiHelper::getStorageSource($params); //filepathname or record id or ""
|
||||||
|
|
||||||
|
if(is_int($storage_source)) { //it is record id
|
||||||
|
$code_stored = modJumiHelper::getCodeStored($storage_source); //code or null(error]
|
||||||
|
}
|
||||||
|
|
||||||
|
require(JModuleHelper::getLayoutPath('mod_jumi'));
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="module" version="1.6.0" method="upgrade">
|
||||||
|
<name>Jumi</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (c) 2006 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||||
|
<authorEmail>info@2glux.com</authorEmail>
|
||||||
|
<authorUrl>http://2glux.com</authorUrl>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
<description>MOD_JUMI_DESC</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename module="mod_jumi">mod_jumi.php</filename>
|
||||||
|
<filename>index.html</filename>
|
||||||
|
<filename>helper.php</filename>
|
||||||
|
<filename>jumi_demo.php</filename>
|
||||||
|
<filename>tmpl/default.php</filename>
|
||||||
|
<filename>tmpl/index.html</filename>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<languages folder="language">
|
||||||
|
<language tag="en-GB">en-GB/en-GB.mod_jumi.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.mod_jumi.ini</language>
|
||||||
|
<language tag="cs-CZ">cs-CZ/cs-CZ.mod_jumi.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.mod_jumi.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.mod_jumi.ini</language>
|
||||||
|
</languages>
|
||||||
|
|
||||||
|
<config>
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic">
|
||||||
|
<field name="notepad" type="textarea" default="" label="Notepad" description="PARAMNOTES" cols="60" rows="3" />
|
||||||
|
<field name="@spacer" type="spacer" default="" label="" description="" />
|
||||||
|
<field name="code_written" type="textarea" default="" label="Code written" description="PARAMCODEWRITTEN" cols="60" rows="17" />
|
||||||
|
<field name="@spacer" type="spacer" default="" label="" description="" />
|
||||||
|
<field name="source_code_storage" type="text" size ="97" default="" label="Source of code" description="PARAMSOURCECODESTORAGE" />
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="advanced">
|
||||||
|
<field name="default_absolute_path" type="text" size ="90" default="" label="Default Absolute Jumi Path" description="PARAMABSPATH" />
|
||||||
|
<field name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" />
|
||||||
|
<field name="cache" type="list" default="1" label="Caching" description="PARAMMODULECACHING">
|
||||||
|
<option value="1">Use global</option>
|
||||||
|
<option value="0">No caching</option>
|
||||||
|
</field>
|
||||||
|
<field name="cache_time" type="text" default="900" label="Cache Time" description="PARAMMODULECACHETIME" />
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
if($code_written.$storage_source != '') { //something to show
|
||||||
|
if($code_written != '') //if code written
|
||||||
|
eval ('?>'.$code_written); //include custom script written
|
||||||
|
|
||||||
|
if($storage_source != '') { // if record id or filepathname
|
||||||
|
if(is_int($storage_source)) { //it is record id
|
||||||
|
if($code_stored != null) {
|
||||||
|
eval ('?>'.$code_stored); //include custom script written
|
||||||
|
} else {
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_RECORD', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
} else { //it is file
|
||||||
|
if(is_readable($storage_source)) {
|
||||||
|
include($storage_source); //include file
|
||||||
|
} else {
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_FILE', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { //nothing to show
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_CONTENT').'</div>';
|
||||||
|
}
|
||||||
|
echo $noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
130
deployed/jumi/administrator/components/com_jumi/plugin/jumi.php
Normal file
130
deployed/jumi/administrator/components/com_jumi/plugin/jumi.php
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import library dependencies
|
||||||
|
jimport('joomla.plugin.plugin');
|
||||||
|
jimport('joomla.event.plugin');
|
||||||
|
|
||||||
|
class plgSystemJumi extends JPlugin {
|
||||||
|
function __construct( &$subject ) {
|
||||||
|
parent::__construct( $subject );
|
||||||
|
// load plugin parameters and language file
|
||||||
|
$this->_plugin = JPluginHelper::getPlugin( 'system', 'jumi' );
|
||||||
|
$this->_params = json_decode( $this->_plugin->params );
|
||||||
|
JPlugin::loadLanguage('plg_system_jumi', JPATH_ADMINISTRATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAfterRender() {
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
if($mainframe->isAdmin())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$plugin = JPluginHelper::getPlugin('system', 'jumi');
|
||||||
|
$pluginParams = json_decode( $plugin->params );
|
||||||
|
|
||||||
|
$content = JResponse::getBody();
|
||||||
|
|
||||||
|
//print_r($pluginParams);exit;
|
||||||
|
|
||||||
|
// expression to search for
|
||||||
|
$regex = '/{(jumi)\s*(.*?)}/i'; //BUG: des not work with written codes containing
|
||||||
|
// if hide_code then replace jumi syntax codes with an empty string
|
||||||
|
if ( $pluginParams->hide_code == 1 ) {
|
||||||
|
$content = preg_replace( $regex, '', $content );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$continuesearching = true;
|
||||||
|
while ($continuesearching){ //Nesting loop
|
||||||
|
// find all instances of $regex (i.e. jumi) in an article and put them in $matches
|
||||||
|
$matches = array();
|
||||||
|
$matches_found = preg_match_all( $regex, $content, $matches, PREG_SET_ORDER );
|
||||||
|
if ($matches_found) {
|
||||||
|
// cycle through all jumi instancies. Put text into $dummy[2]
|
||||||
|
foreach ($matches as $dummy) {
|
||||||
|
//read arguments contained in [] from $dummy[2] and put them into the array $jumi
|
||||||
|
$mms=array();
|
||||||
|
$jumi="";
|
||||||
|
preg_match_all('/\[.*?\]/', $dummy[2], $mms);
|
||||||
|
if ($mms) { //at the least one argument found
|
||||||
|
foreach ($mms as $i=>$mm) {
|
||||||
|
$jumi = preg_replace("/\[|]/", "", $mm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Following syntax {jumi [storage_source][arg1]...[argN]}
|
||||||
|
$storage_source = $this->getStorageSource(trim(array_shift($jumi)), $pluginParams->default_absolute_path); //filepathname or record id or ""
|
||||||
|
$output = ''; // Jumi output
|
||||||
|
|
||||||
|
if($storage_source == '') { //if nothing to show
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::_('ERROR_CONTENT').'</div>';
|
||||||
|
} else { // buffer output
|
||||||
|
ob_start();
|
||||||
|
if(is_int($storage_source)){ //it is record id
|
||||||
|
$code_stored = $this->getCodeStored($storage_source);
|
||||||
|
if($code_stored != null){ //include custom script written
|
||||||
|
eval ('?>'.$code_stored);
|
||||||
|
} else {
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_RECORD', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
} else { //it is file
|
||||||
|
if(is_readable($storage_source)) {
|
||||||
|
include($storage_source); //include file
|
||||||
|
} else {
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_FILE', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($output == ''){ //if there are no errors
|
||||||
|
//$output = str_replace( '$' , '\$' , ob_get_contents()); fixed joomla bug
|
||||||
|
$output = ob_get_contents();
|
||||||
|
}
|
||||||
|
ob_end_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
// final replacement of $regex (i.e. {jumi [][]}) in $article->text by $output
|
||||||
|
$content = preg_replace($regex, $output, $content, 1);
|
||||||
|
}
|
||||||
|
if ($pluginParams->nested_replace == 0) {
|
||||||
|
$continuesearching = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$continuesearching = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
|
$content = str_replace('</body>', $noscript . '</body>', $content);
|
||||||
|
JResponse::setBody($content);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCodeStored($source) { //returns code stored in the database or null.
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
//$user = &JFactory::getUser();
|
||||||
|
//$database->setQuery("select custom_script from #__jumi where id = '{$source}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select custom_script from #__jumi where id = $source");
|
||||||
|
return $database->loadResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStorageSource($source, $abspath) { //returns filepathname or a record id or ""
|
||||||
|
$storage=trim($source);
|
||||||
|
if ($storage!=""){
|
||||||
|
if ($id = substr(strchr($storage,"*"),1)) { //if record id return it
|
||||||
|
return (int)$id;
|
||||||
|
} else { // else return filepathname
|
||||||
|
if($abspath == '')
|
||||||
|
return $storage;
|
||||||
|
else
|
||||||
|
return $abspath.DS.$storage;
|
||||||
|
}
|
||||||
|
} else { // else return ""
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="plugin" group="system" version="2.5" method="upgrade">
|
||||||
|
<name>System - Jumi</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (c) 2006 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||||
|
<authorEmail>info@2glux.com</authorEmail>
|
||||||
|
<authorUrl>http://2glux.com</authorUrl>
|
||||||
|
<version>3.0.4</version>
|
||||||
|
<description>JUMIPLUGINDESC</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename plugin="jumi">jumi.php</filename>
|
||||||
|
<filename>jumi/jumi_demo.php</filename>
|
||||||
|
<filename>jumi/index.html</filename>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<languages folder="language">
|
||||||
|
<language tag="en-GB">en-GB/en-GB.plg_system_jumi.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.plg_content_jumi.ini</language>
|
||||||
|
<language tag="cs-CZ">cs-CZ/cs-CZ.plg_content_jumi.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.plg_content_jumi.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.plg_content_jumi.ini</language>
|
||||||
|
</languages>
|
||||||
|
|
||||||
|
<config>
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic">
|
||||||
|
<field name="default_absolute_path" type="text" size ="80" default="" label="Default Absolute Jumi Path" description="PARAMABSPATH" />
|
||||||
|
<field name="hide_code" type="radio" default="0" label="Hide Jumi code" description="PARAMHIDECODE">
|
||||||
|
<option value="0">No</option>
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
</field>
|
||||||
|
<field name="nested_replace" type="radio" default="0" label="Nested replace" description="PARAMNESTED">
|
||||||
|
<option value="0">No</option>
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
<p><strong>Hello in the world of Jumi!</strong></p>
|
||||||
|
<p>This is the default Jumi demo file.</p>
|
||||||
|
<p>Your current content of $jumi[] array is:</p>
|
||||||
|
<?php
|
||||||
|
if (!empty($jumi)){
|
||||||
|
echo "<ul>\n";
|
||||||
|
foreach ($jumi as $key => $value) {
|
||||||
|
echo '<li>$jumi['.$key.'] = '.$value.'</li>';
|
||||||
|
}
|
||||||
|
echo "</ul>\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<p>empty</p>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p>Jumi is a set of custom code extensions for CMS Joomla! Jumi comes as a component, a plugin and a module.</p>
|
||||||
|
<p>Jumi brings you sufficient power, flexibility and simplicity for quick development and reliable operation of your applications running under Joomla!</p>
|
||||||
|
<p>Jumi resources: <a href="http://edo.webmaster.am/jumi">Downloads & guides</a>, <a href="http://edo.webmaster.am/jumi/tutorial">Tips & tricks</a>.</p>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
# $Id: cs-CZ.plg_content_jumi.ini 95 2009-02-25 10:20:33Z martin2hajek $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIPLUGINDESC="<p>Tento obsahový plugin (content plugin) vkládá do Joomla! článků uživateslký skript: ze souboru nebo z databázového záznamu Jumi komponenty.</p><p><b>Užití: {jumi [uložený_kód] [arg1] [arg2] ... [argN]}</b><br />kde</p><ul><li><b>uložený_kód</b><br />je buď jméno souboru ke vložení, nebo<br />ID záznamu v databázi Jumi komponenty.<br />Cesta k souboru je relativní vzhledem k Přednastavené Absolutní cestě, která může být definována v parametrech pluginu. Pokud není definována pluginem, je rovna kořenovému adresáři Joomla!.<br />ID záznamu musí předcházet hvěydička (např. *4).</li><li><b>[arg1] ... [argN]</b><br />jsou volitelné Jumi argumenty. Záleží na vašem uloženém kódu, zda je umí zpracovat. Argumenty jsou z vloženého php kódu pomocí pole $jumi[].</li></ul><p>Příklad vložení souboru + argumenty: {jumi [plugins/content/jumi/jumi_demo.php][first][second]}</p><p>Příklad vložení z databáze: {jumi [*1]}</p><p>K dispozici je též kompatibilní Jumi komponenta a modul.</p><p>Další informace a zdroje: <a href="http://2glux.com/projects/jumi">Stahování a manuály</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tipy & triky</a>.</p>"
|
||||||
|
PARAMABSPATH="Volitelná Přednastavená Absolutní cesta pro vkládání souborů. Slouží jako automatická předpona k zadané cestě. Nedělejte žádné sleše na konci.Necháte-li toto prázdné, je identická s kořenovým adresářem Joomla!."
|
||||||
|
PARAMHIDECODE="Je-li nastaveno na Yes pak Jumi kód není zobrazen, ani není zpracován."
|
||||||
|
PARAMNESTED="Je-li nastaveno na Yes pak Jumi vloží kód a nalezne-li v něm Jumi příkazovou syntaxi, vykoná jí také."
|
||||||
|
ERROR_CONTENT="Jumi funguje, ale není nic, <b>co bz šlo ukázat</b>.<br />Specifikujte zdroj kódu (prní hranatá závorka)."
|
||||||
|
ERROR_FILE="Soubor<br /><b>%s</b><br />neexistuje, nebo jej není možné přečíst!"
|
||||||
|
ERROR_RECORD="Záznam ID:<b>%d</b> neexistuje!"
|
||||||
|
HIDE JUMI CODE="Schovat Jumi kód"
|
||||||
|
DEFAULT ABSOLUTE JUMI PATH="Přednastavená Absolutní Jumi Cesta"
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
# $Id: en-GB.plg_content_jumi.ini 95 2009-02-25 10:20:33Z martin2hajek $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIPLUGINDESC="<p>This content plugin includes into Joomla! articles custom script: from a file or from Jumi component database record.</p><p><b>Usage: {jumi [stored_code_source] [arg1] [arg2] ... [argN]}</b><br />where</p><ul><li><b>stored_code_source</b><br />is a filepathname to be included or<br />ID of Jumi componet databese table record.<br />The filepathname is a relative one with respect to Default Absolute Path that can be set in the plugin parameters. If not set then is equivalent to Joomla! root.<br />The record ID must be preceeded by an asterrisk (e.g. *4).</li><li><b>[arg1] ... [argN]</b><br />are optional jumi arguments. It depends on your custom included php file if it can handle them. Arguments can be accessed by $jumi[] array in an included php file.</li></ul><p>Example of file inclusion + arguments: {jumi [plugins/system/jumi/jumi/jumi_demo.php][first][second]}</p><p>Example of component database record inclusion: {jumi [*1]}</p><p>There is also a compatible Jumi module and a component.</p><p>Additional information and resources: <a href="http://2glux.com/projects/jumi">Downloads & guides</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tutorial</a>.</p>"
|
||||||
|
PARAMABSPATH="Optional Default Absolute Path to the included file. It is prepend to filepathname to be included. If left blank then it is identical to Joomla! root directory. No slash at the end."
|
||||||
|
PARAMHIDECODE="If set to Yes the Jumi code is not displayed and not processed."
|
||||||
|
PARAMNESTED="If set to Yes the Jumi code will include a code and apply the replacement of Jumi syntax command in it too."
|
||||||
|
ERROR_CONTENT="Jumi is working but there is <b>nothing to be shown</b>.<br />Specify the source of the code (first square brackets)."
|
||||||
|
ERROR_FILE="The file <b>%s</b> does not exist or is not readable!"
|
||||||
|
ERROR_RECORD="Record ID:<b>%d</b> does not exist!"
|
||||||
|
HIDE JUMI CODE="Hide Jumi code"
|
||||||
|
DEFAULT ABSOLUTE JUMI PATH="Default Absolute Jumi Path"
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
# $Id: es-ES.plg_content_jumi.ini 95 2009-02-25 10:20:33Z martin2hajek $
|
||||||
|
# translated by dagget, www.joomlanetprojects.com
|
||||||
|
# administracion@joomlanetprojects.com
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIPLUGINDESC="<p>Este plugin de contenido incluye scripts en los artículos de Joomla!: desde un archivo o desde la base de datos del componente Jumi.</p><p><b>Uso: {jumi [codigo_fuente] [arg1] [arg2] ... [argN]}</b><br />where</p><ul><li><b>codigo_fuente</b><br />es la ruta y nombre del archivo a incluir o<br /> la ID de la tabla donde se guardo el código.<br />La ruta y nombre puede ser relativa a la ruta ofrecida desde los parámetros del plugin. Si no es equivalente al raíz de Joomla!.<br />La id debe ir precedida de un asterisko (e.g. *4).</li><li><b>[arg1] ... [argN]</b><br />son argumentos opcionales. Esto depende del archivo a incluir. Los argumentos son accesibles desde el array $jumi[] en el archivo incluido.</li></ul><p>Ejemplos de inclusion + argumentos: {jumi [plugins/content/jumi/jumi_demo.php][primero][segundo]}</p><p>Ejemplo de inclusión desde la base de datos a través de la id: {jumi [*1]}</p><p>Existe un módulo y un plugin Jumi totalmente compatibles.</p><p>Información adicional y recursos: <a href="http://2glux.com/projects/jumi">Descargas y guias</a>, <a href="http://2glux.com/projects/jumi/tutorial">Trucos</a>.</p>"
|
||||||
|
PARAMABSPATH="Ruta absoluta opcional de los archivos incluidos. Si se deja en blanco se tomará el raíz de Joomla! por defecto. Sin barra al final."
|
||||||
|
PARAMHIDECODE="SI se selecciona Sí, el código Jumi no será mostrado ni procesado."
|
||||||
|
PARAMNESTED="Si se selecciona sí y el código suministrado incluye la sintaxis jumi[], esta será procesada también."
|
||||||
|
ERROR_CONTENT="Jumi está activo pero <b>no hay nada que mostrar</b>.<br />Especifica el código fuente (primeros corchetes)."
|
||||||
|
ERROR_FILE="El archivo<br /><b>%s</b><br />no existe o no tiene permisos de lectura!"
|
||||||
|
ERROR_RECORD="La ID:<b>%d</b> no existe en la base de datos!"
|
||||||
|
HIDE JUMI CODE="Ocultar código Jumi"
|
||||||
|
DEFAULT ABSOLUTE JUMI PATH="Ruta absoluta de Jumi por defecto"
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
# $Id: hy-AM.plg_content_jumi.ini 95 2009-02-25 10:20:33Z martin2hajek $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIPLUGINDESC="<p>Այս տեղակայքի փլագինը ներբեռնում է սցենարներ Joomla! հոդվաշներում:</p><p><b>Օգտագործում. {jumi [stored_code_source] [arg1] [arg2] ... [argN]}</b><br />որտեղ</p><ul><li><b>stored_code_source</b><br />դա ներբեռնվող ֆայլի արահետն է կամ<br />Jumi հավելվածի համարը պահոցում.<br />Ֆայլի արահետը հարաբերական է համր բացարձակ արահետին, որը կարող է նշվել փլագինի պարամետրերում: Եթե նշված չէ, ապա համարժեք է Joomla!-ի արմատային պահոցին:<br />Գրառման համարը պետք է կատարվի աստղանիշի օգնությամբ (օրինակ *4).</li><li><b>[arg1] ... [argN]</b><br />դրանք ոչ պարտադիր արգումենտներ են: Դրանք կաշխատեն, եթե ձեր սցենարը կարող է նրանցից օգտվել: Արգումենտները կարող են կարդացվել $jumi[] մասիվի միջոցով ներբեռնոած ֆայլից:</li></ul><p>Պարամետրերով ներբեռնման օրինակ: {jumi [plugins/content/jumi/jumi_demo.php][first][second]}</p><p>Հավելվածի ներբեռնման օրինակ: {jumi [*1]}</p><p>Կան նաև համատեղ մոդուլ և քոմփոնենթ:</p><p>Հավելյալ տեղեկություններ. <a href="http://2glux.com/projects/jumi">Downloads & guides</a>, <a href="http://2glux.com/projects/jumi/tutorial">Tips & tricks</a>.</p>"
|
||||||
|
PARAMABSPATH="Ոչ անհրաժեշտ Jumi-ի համր բացարձակ արահետը ֆայլը ներբեռնելու համար: Այն ավելացվում է ներբեռնվող ֆայլի արահետի սկզբում: Եթե նշված չէ, ապա համարժեք է Joomla!-ի արմատային պահոցին: Օգտագործեք առանց վերջում թեք նշանի:"
|
||||||
|
PARAMHIDECODE="Եթե ընտրված է Այո, ապա Jumi սցենարը չի ցուցադրվում և չի կատարվում:"
|
||||||
|
PARAMNESTED="Եթե ընտրված է Այո, ապա Jumi-ն սցենարը ներբեռնելուց բացի կկատարի նաև ներբեռնված սցենարում ընդգրկված Jumi հրամանները:"
|
||||||
|
ERROR_CONTENT="Jumi-ն աշխատում է, բայց <b>չկա ոչինչ ցուցադրելու համար</b>:<br />Նշեք սցենարի ակունքը առաջին քառակուսի փակագծերում:"
|
||||||
|
ERROR_FILE="<b>%s</b> ֆայլը գոյություն չունի կամ չի կարող կարդացվել!"
|
||||||
|
ERROR_RECORD="Գրառում ID:<b>%d</b>-ը գոյություն չունի!"
|
||||||
|
HIDE JUMI CODE="Թաքցնել Jumi կոդը"
|
||||||
|
DEFAULT ABSOLUTE JUMI PATH="Jumi-ի համր բացարձակ արահետը"
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
# $Id: ru-RU.plg_content_jumi.ini 95 2009-02-25 10:20:33Z martin2hajek $
|
||||||
|
# Note : All ini files need to be saved as UTF-8 - No BOM
|
||||||
|
|
||||||
|
JUMIPLUGINDESC="<p>Этот плагин включает настраиваемoе содержание в статьи Joomla! из файла или из Jumi компоненты.</p><p><b>Использование: {jumi [stored_code_source] [arg1] [arg2] ... [argN]}</b><br />где</p><ul><li><b>stored_code_source</b><br />путь файла, которые должны быть включены или<br />номер приложения Jumi компоненты<br />Путь файл является относительным к абсолютной пути по умолчанию, который может быть установлен в параметрах плагина. Если оставить пустым, то будет идентичен корневому каталогу Joomla.<br />Номеру приложения должно предшествовать звездочка (например *4).</li><li><b>[arg1] ... [argN]</b><br />являются необязательными аргументами, зависящие от вашего скрипта. Достип к аргументам можно получить с помощью $jumi[] массива.</li></ul><p>Пример включения файла с аргументами: {jumi [plugins/content/jumi/jumi_demo.php][first][second]}</p><p>Примир включения приложения: {jumi [*1]}</p><p>Существует также совместимые с плагином Jumi модуль и компонента.</p><p>Дополнительные ресурсы: <a href="http://2glux.com/projects/jumi">Дистрибутивы и инструкции</a>, <a href="http://2glux.com/projects/jumi/tutorial">Советы и хитрости</a>.</p>"
|
||||||
|
PARAMABSPATH="Не обязательный абсолютный путь для включаемого файла. Это ставится впереди пути файла, который должен быть включен. Если оставить пустым, то будет идентичен корневому каталогу Joomla. Используйте без / в конце."
|
||||||
|
PARAMHIDECODE="Если установлено значение Да, Jumi код не отображается и не обрабатывается."
|
||||||
|
PARAMNESTED="Если установлено значение Да, Jumi включит код и также исполнит Jumi код находяшийся в включаемом коде."
|
||||||
|
ERROR_CONTENT="Jumi работает, но <b>нечего показывать</b>.<br />Введите код и/или укажите непустой код."
|
||||||
|
ERROR_FILE="Файл <b>%s</b> не существует или не является чтимым!"
|
||||||
|
ERROR_RECORD="Запись с ID:<b>%d</b> не существует!"
|
||||||
|
HIDE JUMI CODE="Скрыть Jumi код"
|
||||||
|
DEFAULT ABSOLUTE JUMI PATH="Абсолютный путь Jumi по умолчанию"
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport( 'joomla.plugin.plugin' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JumiRouter plugin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class plgSystemJumiRouter extends JPlugin {
|
||||||
|
function __construct(& $subject, $config) {
|
||||||
|
// check to see if we are on frontend to execute plugin
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
if($mainframe->isAdmin())
|
||||||
|
return;
|
||||||
|
|
||||||
|
parent::__construct($subject, $config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routes URLs
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function onAfterInitialise() {
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
$uri = JURI::getInstance();
|
||||||
|
$router = $mainframe->getRouter();
|
||||||
|
|
||||||
|
$router->attachParseRule('parseJumiRouter');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SEF url parser
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @static
|
||||||
|
* @param $router object of JRouter class
|
||||||
|
* @param $uri object of JURI class
|
||||||
|
*/
|
||||||
|
function parseJumiRouter(& $router, & $uri) {
|
||||||
|
if($router->getMode() == JROUTER_MODE_RAW)
|
||||||
|
return array();
|
||||||
|
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
$db->setQuery('select id, title, alias from #__jumi where published = 1');
|
||||||
|
$apps = $db->loadRowList();
|
||||||
|
$alias = array();
|
||||||
|
foreach($apps as $i=>$app) {
|
||||||
|
if(empty($app[2]))
|
||||||
|
$apps[$i][2] = JFilterOutput::stringURLSafe($app[1]);
|
||||||
|
$alias[$i] = $apps[$i][2];
|
||||||
|
}
|
||||||
|
|
||||||
|
$segments = explode('/', $uri->getPath());
|
||||||
|
foreach($segments as $i => $segment)
|
||||||
|
if(($j = array_search($segment, $alias)) !== false) {
|
||||||
|
unset($segments[$i]);
|
||||||
|
$uri->setVar('option', 'com_jumi');
|
||||||
|
$uri->setVar('fileid', $apps[$j][0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$uri->setPath(implode('/', $segments));
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="plugin" group="system" version="1.6" method="upgrade">
|
||||||
|
<name>System - Jumi Router</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (C) 2008 - 2011 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||||
|
<authorEmail>edo888@gmail.com</authorEmail>
|
||||||
|
<authorUrl>http://edo.webmaster.am</authorUrl>
|
||||||
|
<version>2.0.6</version>
|
||||||
|
<description>SEF routing plugin for Jumi, which will enable direct access to jumi application with it's alias.</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename plugin="jumirouter">jumirouter.php</filename>
|
||||||
|
</files>
|
||||||
|
</extension>
|
||||||
124
deployed/jumi/administrator/components/com_jumi/scriptfile.php
Normal file
124
deployed/jumi/administrator/components/com_jumi/scriptfile.php
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright Copyright (C) 2006 - 2015 Edvard Ananyan. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
class com_jumiInstallerScript {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to install the component
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function install($parent) {
|
||||||
|
// $parent is the class calling this method
|
||||||
|
//$parent->getParent()->setRedirectURL('index.php?option=com_helloworld');
|
||||||
|
|
||||||
|
// installing module
|
||||||
|
$module_installer = new JInstaller;
|
||||||
|
if(@$module_installer->install(dirname(__FILE__).DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'module'))
|
||||||
|
echo 'Module install success', '<br />';
|
||||||
|
else
|
||||||
|
echo 'Module install failed', '<br />';
|
||||||
|
|
||||||
|
// installing plugin
|
||||||
|
$plugin_installer = new JInstaller;
|
||||||
|
if($plugin_installer->install(dirname(__FILE__).DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'plugin'))
|
||||||
|
echo 'Plugin install success', '<br />';
|
||||||
|
else
|
||||||
|
echo 'Plugin install failed', '<br />';
|
||||||
|
|
||||||
|
// installing router
|
||||||
|
$plugin_installer = new JInstaller;
|
||||||
|
if($plugin_installer->install(dirname(__FILE__).DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'router'))
|
||||||
|
echo 'Router install success', '<br />';
|
||||||
|
else
|
||||||
|
echo 'Router install failed', '<br />';
|
||||||
|
|
||||||
|
// enabling plugin
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
$db->setQuery('update #__extensions set enabled = 1 where element = "jumi" and folder = "system"');
|
||||||
|
$db->query();
|
||||||
|
|
||||||
|
// enabling router
|
||||||
|
$db->setQuery('update #__extensions set enabled = 1, ordering = 100 where element = "jumirouter" and folder = "system"');
|
||||||
|
$db->query();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to uninstall the component
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function uninstall($parent) {
|
||||||
|
// $parent is the class calling this method
|
||||||
|
//echo '<p>' . JText::_('COM_HELLOWORLD_UNINSTALL_TEXT') . '</p>';
|
||||||
|
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
|
||||||
|
// uninstalling jumi module
|
||||||
|
$db->setQuery("select extension_id from #__extensions where name = 'Jumi' and type = 'module' and element = 'mod_jumi'");
|
||||||
|
$jumi_module = $db->loadObject();
|
||||||
|
$module_uninstaller = new JInstaller;
|
||||||
|
if(@$module_uninstaller->uninstall('module', $jumi_module->extension_id))
|
||||||
|
echo 'Module uninstall success', '<br />';
|
||||||
|
else {
|
||||||
|
echo 'Module uninstall failed', '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
// uninstalling jumi plugin
|
||||||
|
$db->setQuery("select extension_id from #__extensions where name = 'System - Jumi' and type = 'plugin' and element = 'jumi'");
|
||||||
|
$jumi_plugin = $db->loadObject();
|
||||||
|
$plugin_uninstaller = new JInstaller;
|
||||||
|
if($plugin_uninstaller->uninstall('plugin', $jumi_plugin->extension_id))
|
||||||
|
echo 'Plugin uninstall success', '<br />';
|
||||||
|
else
|
||||||
|
echo 'Plugin uninstall failed', '<br />';
|
||||||
|
|
||||||
|
// uninstalling jumi router
|
||||||
|
$db->setQuery("select extension_id from #__extensions where name = 'System - Jumi Router' and type = 'plugin' and element = 'jumirouter'");
|
||||||
|
$jumi_router = $db->loadObject();
|
||||||
|
$plugin_uninstaller = new JInstaller;
|
||||||
|
if($plugin_uninstaller->uninstall('plugin', $jumi_router->extension_id))
|
||||||
|
echo 'Router uninstall success', '<br />';
|
||||||
|
else
|
||||||
|
echo 'Router uninstall failed', '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to update the component
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function update($parent) {
|
||||||
|
// $parent is the class calling this method
|
||||||
|
//echo '<p>' . JText::_('COM_HELLOWORLD_UPDATE_TEXT') . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to run before an install/update/uninstall method
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function preflight($type, $parent) {
|
||||||
|
// $parent is the class calling this method
|
||||||
|
// $type is the type of change (install, update or discover_install)
|
||||||
|
//echo '<p>' . JText::_('COM_HELLOWORLD_PREFLIGHT_' . $type . '_TEXT') . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method to run after an install/update/uninstall method
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function postflight($type, $parent) {
|
||||||
|
// $parent is the class calling this method
|
||||||
|
// $type is the type of change (install, update or discover_install)
|
||||||
|
//echo '<p>' . JText::_('COM_HELLOWORLD_POSTFLIGHT_' . $type . '_TEXT') . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
DROP TABLE IF EXISTS `#__jumi`;
|
||||||
|
|
||||||
|
DELETE FROM `#__menu` where link LIKE 'index.php?option=com_jumi%';
|
||||||
@ -0,0 +1,215 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: default.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
$row = $this->row;
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<?php if(version_compare( JVERSION, '1.6.0', 'lt' )) { ?>
|
||||||
|
function submitbutton(task) {
|
||||||
|
<?php } else { ?>
|
||||||
|
Joomla.submitbutton = function(task) {
|
||||||
|
<?php } ?>
|
||||||
|
var form = document.adminForm;
|
||||||
|
if (task == 'cancel') {
|
||||||
|
submitform( task );
|
||||||
|
}
|
||||||
|
else if (form.title.value == "") {
|
||||||
|
form.title.style.border = "1px solid red";
|
||||||
|
form.title.focus();
|
||||||
|
alert( "<?php echo JText::_('COM_JUMI_NEEDTITLE', true ); ?>" );
|
||||||
|
}
|
||||||
|
else if(form.custom_script.value == "" && form.path.value == "") {
|
||||||
|
alert( "<?php echo JText::_('COM_JUMI_NEEDSCRIPT', true ); ?>" );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
submitform( task );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||||
|
|
||||||
|
<fieldset class="adminform">
|
||||||
|
<legend><?php echo JText::_('COM_JUMI_DETAILS'); ?></legend>
|
||||||
|
|
||||||
|
<table class="admintable">
|
||||||
|
<tr>
|
||||||
|
<td width="200" class="key">
|
||||||
|
<label for="title">
|
||||||
|
<?php echo JText::_( 'COM_JUMI_TITLE' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="title" id="title" size="60" value="<?php echo @$row->title; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="200" class="key">
|
||||||
|
<label for="alias">
|
||||||
|
<?php echo JText::_( 'Alias' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="alias" id="alias" size="60" value="<?php echo @$row->alias; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="key">
|
||||||
|
<label for="custom_script">
|
||||||
|
<?php echo JHTML::_('tooltip', JTEXT::_('COM_JUMI_CUSTOMSCRIPT')); ?> <?php echo JText::_( 'COM_JUMI_CUSTOM_SCRIPT' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><textarea name="custom_script" id="custom_script" cols="80" rows="10"><?php echo @$row->custom_script; ?></textarea></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="key">
|
||||||
|
|
||||||
|
<label for="path">
|
||||||
|
<?php echo JHTML::_('tooltip', JTEXT::_('COM_JUMI_INCLFILE')); ?> <?php echo JText::_( 'COM_JUMI_PATHNAME' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="path" id="path" size="60" value="<?php echo @$row->path; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="clr"></div>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="save" />
|
||||||
|
<input type="hidden" name="option" value="com_jumi" />
|
||||||
|
<input type="hidden" name="controller" value="application" />
|
||||||
|
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
|
||||||
|
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
|
||||||
|
<input type="hidden" name="textfieldcheck" value="<?php echo @$n; ?>" />
|
||||||
|
</form>
|
||||||
|
<table class="adminlist" style="width: 100%;margin-top: 12px;"><tr>
|
||||||
|
<td align="center" valign="middle" id="jumi_td" style="">
|
||||||
|
<a href="http://2glux.com/projects/jumi" style="font-size: 12px;" target="_blank">Jumi</a> developed by <a href="http://2glux.com" target="_blank">2GLux.com</a>
|
||||||
|
<div style="position: absolute;right: 2px;top: 7px;">
|
||||||
|
<a href="http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/1023" target="_blank" id="jumi_rate" class="jumi_bottom_icon" title="If you like Jumi, Rate Us PLEASE"> </a>
|
||||||
|
<a href="http://2glux.com/projects/jumi" target="_blank" id="jumi_homepage" style="margin: 0 2px 0 0px;" class="jumi_bottom_icon" title="Project Homepage"> </a>
|
||||||
|
<a href="http://2glux.com" target="_blank" id="jumi_developer" class="jumi_bottom_icon" title="2GLux Company"> </a>
|
||||||
|
<a href="http://2glux.com/forum/jumi/" target="_blank" id="jumi_support" class="jumi_bottom_icon" title="Support Forum"> </a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr></table>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||||
|
JHtml::_('bootstrap.tooltip');
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<?php if(version_compare( JVERSION, '1.6.0', 'lt' )) { ?>
|
||||||
|
function submitbutton(task) {
|
||||||
|
<?php } else { ?>
|
||||||
|
Joomla.submitbutton = function(task) {
|
||||||
|
<?php } ?>
|
||||||
|
var form = document.adminForm;
|
||||||
|
if (task == 'cancel') {
|
||||||
|
submitform( task );
|
||||||
|
}
|
||||||
|
else if (form.title.value == "") {
|
||||||
|
form.title.style.border = "1px solid red";
|
||||||
|
form.title.focus();
|
||||||
|
alert( "<?php echo JText::_('COM_JUMI_NEEDTITLE', true ); ?>" );
|
||||||
|
}
|
||||||
|
else if(form.custom_script.value == "" && form.path.value == "") {
|
||||||
|
alert( "<?php echo JText::_('COM_JUMI_NEEDSCRIPT', true ); ?>" );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
submitform( task );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||||
|
|
||||||
|
<fieldset class="adminform">
|
||||||
|
<legend><?php echo JText::_('COM_JUMI_DETAILS'); ?></legend>
|
||||||
|
|
||||||
|
<table class="admintable">
|
||||||
|
<tr>
|
||||||
|
<td width="200" class="key">
|
||||||
|
<label for="title">
|
||||||
|
<?php echo JText::_( 'COM_JUMI_TITLE' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="title" id="title" size="60" value="<?php echo @$row->title; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="200" class="key">
|
||||||
|
<label for="alias">
|
||||||
|
<?php echo JText::_( 'Alias' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="alias" id="alias" size="60" value="<?php echo @$row->alias; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="key">
|
||||||
|
<label for="custom_script">
|
||||||
|
<?php echo JHTML::_('tooltip', JTEXT::_('COM_JUMI_CUSTOMSCRIPT')); ?> <?php echo JText::_( 'COM_JUMI_CUSTOM_SCRIPT' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><textarea name="custom_script" id="custom_script" cols="80" rows="10"><?php echo @$row->custom_script; ?></textarea></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="key">
|
||||||
|
|
||||||
|
<label for="path">
|
||||||
|
<?php echo JHTML::_('tooltip', JTEXT::_('COM_JUMI_INCLFILE')); ?> <?php echo JText::_( 'COM_JUMI_PATHNAME' ); ?>:
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="inputbox" type="text" name="path" id="path" size="60" value="<?php echo @$row->path; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="clr"></div>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="save" />
|
||||||
|
<input type="hidden" name="option" value="com_jumi" />
|
||||||
|
<input type="hidden" name="controller" value="application" />
|
||||||
|
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
|
||||||
|
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
|
||||||
|
<input type="hidden" name="textfieldcheck" value="<?php echo @$n; ?>" />
|
||||||
|
</form>
|
||||||
|
<table class="adminlist" style="width: 100%;margin-top: 12px;"><tr>
|
||||||
|
<td align="center" valign="middle" id="jumi_td" style="">
|
||||||
|
<a href="http://2glux.com/projects/jumi" style="font-size: 12px;" target="_blank">Jumi</a> developed by <a href="http://2glux.com" target="_blank">2GLux.com</a>
|
||||||
|
<div style="position: absolute;right: 2px;top: 7px;">
|
||||||
|
<a href="http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/1023" target="_blank" id="jumi_rate" class="jumi_bottom_icon" title="If you like Jumi, Rate Us PLEASE"> </a>
|
||||||
|
<a href="http://2glux.com/projects/jumi" target="_blank" id="jumi_homepage" style="margin: 0 2px 0 0px;" class="jumi_bottom_icon" title="Project Homepage"> </a>
|
||||||
|
<a href="http://2glux.com" target="_blank" id="jumi_developer" class="jumi_bottom_icon" title="2GLux Company"> </a>
|
||||||
|
<a href="http://2glux.com/forum/jumi/" target="_blank" id="jumi_support" class="jumi_bottom_icon" title="Support Forum"> </a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr></table>
|
||||||
|
|
||||||
|
<?php }?>
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: view.html.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexypolling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import Joomla! libraries
|
||||||
|
jimport( 'joomla.application.component.view');
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiVieweditApplication extends JView {
|
||||||
|
function display($tpl = null) {
|
||||||
|
//get the data
|
||||||
|
$application = $this->get('Data');
|
||||||
|
|
||||||
|
$isNew = ($application->id < 1);
|
||||||
|
|
||||||
|
$text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
|
||||||
|
JToolBarHelper::title( JText::_( 'Jumi Application' ).': <small><small>[ ' . $text.' ]</small></small>','manage.png' );
|
||||||
|
JToolBarHelper::save();
|
||||||
|
if ($isNew) {
|
||||||
|
JToolBarHelper::cancel();
|
||||||
|
} else {
|
||||||
|
JToolBarHelper::apply();
|
||||||
|
// for existing items the button is renamed `close`
|
||||||
|
JToolBarHelper::cancel( 'cancel', 'Close' );
|
||||||
|
}
|
||||||
|
JToolBarHelper::help('screen.applications.edit');
|
||||||
|
|
||||||
|
$this->assignRef('row', $application);
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiVieweditApplication extends JViewLegacy {
|
||||||
|
function display($tpl = null) {
|
||||||
|
//get the data
|
||||||
|
$application = $this->get('Data');
|
||||||
|
|
||||||
|
$isNew = ($application->id < 1);
|
||||||
|
|
||||||
|
$text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
|
||||||
|
JToolBarHelper::title( JText::_( 'Jumi Application' ).': <small><small>[ ' . $text.' ]</small></small>','manage.png' );
|
||||||
|
JToolBarHelper::save();
|
||||||
|
if ($isNew) {
|
||||||
|
JToolBarHelper::cancel();
|
||||||
|
} else {
|
||||||
|
JToolBarHelper::apply();
|
||||||
|
// for existing items the button is renamed `close`
|
||||||
|
JToolBarHelper::cancel( 'cancel', 'Close' );
|
||||||
|
}
|
||||||
|
JToolBarHelper::help('screen.applications.edit');
|
||||||
|
|
||||||
|
$this->assignRef('row', $application);
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -0,0 +1,299 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: default.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexy_polling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
?>
|
||||||
|
<form action="index.php?option=com_jumi" method="post" name="adminForm" id="adminForm">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="left" width="100%">
|
||||||
|
<?php echo JText::_( 'Filter' ); ?>:
|
||||||
|
<input type="text" name="search" id="search" value="<?php echo $this->filter->search;?>" class="text_area" onchange="document.adminForm.submit();" />
|
||||||
|
<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
|
||||||
|
<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
|
||||||
|
</td>
|
||||||
|
<td nowrap="nowrap">
|
||||||
|
<?php
|
||||||
|
echo JHTML::_('grid.state', $this->filter->filter_state );
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="tablecell">
|
||||||
|
<table class="adminlist">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="1%">
|
||||||
|
<?php echo JText::_( 'NUM' ); ?>
|
||||||
|
</th>
|
||||||
|
<th width="2%">
|
||||||
|
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
|
||||||
|
</th>
|
||||||
|
<th class="title">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Title', 'm.title', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<th width="30%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Path', 'm.path', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<th width="8%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Published', 'm.published', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<!--th width="12%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Access', 'g.name', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th-->
|
||||||
|
<th width="1%" nowrap="nowrap">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'ID', 'm.id', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<?php
|
||||||
|
$k = 0;
|
||||||
|
for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
|
||||||
|
|
||||||
|
|
||||||
|
$row = $this->items[$i];
|
||||||
|
$checked = JHTML::_( 'grid.id', $i, $row->id );
|
||||||
|
$link = JRoute::_( 'index.php?option=com_jumi&controller=application&task=edit&cid[]='. $row->id );
|
||||||
|
$published = JHTML::_('grid.published', $row, $i );
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr class="<?php echo "row$k"; ?>">
|
||||||
|
<td>
|
||||||
|
<?php echo $this->pagination->getRowOffset( $i ); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $checked; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="<?php echo $link; ?>" title="<?php echo JText::_( 'Edit Application' ); ?>">
|
||||||
|
<?php echo $row->title; ?></a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $row->path; ?>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $published; ?>
|
||||||
|
</td>
|
||||||
|
<!--td align="center">
|
||||||
|
<?php echo $accesslevel; ?>
|
||||||
|
</td-->
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $row->id; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$k = 1 - $k;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tfoot>
|
||||||
|
<td colspan="8">
|
||||||
|
<?php echo $this->pagination->getListFooter(); ?>
|
||||||
|
</td>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="" />
|
||||||
|
<input type="hidden" name="option" value="com_jumi" />
|
||||||
|
<input type="hidden" name="controller" value="application" />
|
||||||
|
<input type="hidden" name="boxchecked" value="0" />
|
||||||
|
<input type="hidden" name="filter_order" value="<?php echo $this->filter->filter_order; ?>" />
|
||||||
|
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter->filter_order_Dir; ?>" />
|
||||||
|
</form>
|
||||||
|
<table class="adminlist" style="width: 100%;margin-top: 12px;"><tr>
|
||||||
|
<td align="center" valign="middle" id="jumi_td" style="">
|
||||||
|
<a href="http://2glux.com/projects/jumi" style="font-size: 12px;" target="_blank">Jumi</a> developed by <a href="http://2glux.com" target="_blank">2GLux.com</a>
|
||||||
|
<div style="position: absolute;right: 2px;top: 7px;">
|
||||||
|
<a href="http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/1023" target="_blank" id="jumi_rate" class="jumi_bottom_icon" title="If you like Jumi, Rate Us PLEASE"> </a>
|
||||||
|
<a href="http://2glux.com/projects/jumi" target="_blank" id="jumi_homepage" style="margin: 0 2px 0 0px;" class="jumi_bottom_icon" title="Project Homepage"> </a>
|
||||||
|
<a href="http://2glux.com" target="_blank" id="jumi_developer" class="jumi_bottom_icon" title="2GLux Company"> </a>
|
||||||
|
<a href="http://2glux.com/forum/jumi/" target="_blank" id="jumi_support" class="jumi_bottom_icon" title="Support Forum"> </a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr></table>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||||
|
JHtml::_('bootstrap.tooltip');
|
||||||
|
JHtml::_('behavior.multiselect');
|
||||||
|
JHtml::_('dropdown.init');
|
||||||
|
JHtml::_('formbehavior.chosen', 'select');
|
||||||
|
|
||||||
|
$listOrder = $this->escape($this->filter->filter_order);
|
||||||
|
$listDirn = $this->escape($this->filter->filter_order_Dir);
|
||||||
|
$sortFields = $this->getSortFields();
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
Joomla.orderTable = function() {
|
||||||
|
table = document.getElementById("sortTable");
|
||||||
|
direction = document.getElementById("directionTable");
|
||||||
|
order = table.options[table.selectedIndex].value;
|
||||||
|
if (order != '<?php echo $listOrder; ?>') {
|
||||||
|
dirn = 'asc';
|
||||||
|
} else {
|
||||||
|
dirn = direction.options[direction.selectedIndex].value;
|
||||||
|
}
|
||||||
|
Joomla.tableOrdering(order, dirn, '');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form action="index.php?option=com_jumi" method="post" name="adminForm" id="adminForm">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="left" width="100%">
|
||||||
|
<div id="filter-bar" class="btn-toolbar">
|
||||||
|
<div class="filter-search btn-group pull-left">
|
||||||
|
<label for="search" class="element-invisible"></label>
|
||||||
|
<input type="text" name="search" id="search" placeholder="<?php echo JText::_( 'Filter Applications by Title' ); ?>" value="<?php echo $this->filter->search;?>" title="<?php echo JText::_( 'Filter Applications by Title' ); ?>" />
|
||||||
|
</div>
|
||||||
|
<div class="btn-group pull-left">
|
||||||
|
<button class="btn hasTooltip" type="submit" title="<?php echo JText::_( 'Search' ); ?>"><i class="icon-search"></i></button>
|
||||||
|
<button class="btn hasTooltip" type="button" title="<?php echo JText::_( 'Reset' ); ?>" onclick="document.id('search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="filter-search btn-group pull-left">
|
||||||
|
<?php echo JHTML::_('grid.state', $this->filter->filter_state );?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="btn-group pull-right hidden-phone">
|
||||||
|
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||||
|
<?php echo $this->pagination->getLimitBox(); ?>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group pull-right hidden-phone">
|
||||||
|
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
||||||
|
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||||
|
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
||||||
|
<option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||||
|
<option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group pull-right">
|
||||||
|
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
||||||
|
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||||
|
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
||||||
|
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td nowrap="nowrap">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="tablecell">
|
||||||
|
<table class="table table-striped" id="articleList">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="1%" class="nowrap center hidden-phone">
|
||||||
|
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
|
||||||
|
</th>
|
||||||
|
<th width="1%" class="hidden-phone">
|
||||||
|
<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
|
||||||
|
</th>
|
||||||
|
<th class="title">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Title', 'm.title', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<th width="30%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Path', 'm.path', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<th width="8%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Published', 'm.published', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
<!--th width="12%" align="center">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'Access', 'g.name', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th-->
|
||||||
|
<th width="1%" nowrap="nowrap">
|
||||||
|
<?php echo JHTML::_('grid.sort', 'ID', 'm.id', @$this->filter->filter_order_Dir, @$this->filter->filter_order ); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<?php
|
||||||
|
$k = 0;
|
||||||
|
for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
|
||||||
|
|
||||||
|
|
||||||
|
$row = $this->items[$i];
|
||||||
|
$checked = JHTML::_( 'grid.id', $i, $row->id );
|
||||||
|
$link = JRoute::_( 'index.php?option=com_jumi&controller=application&task=edit&cid[]='. $row->id );
|
||||||
|
$published = JHtml::_('jgrid.published', $row->published, $i);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr class="row<?php echo $i % 2; ?>">
|
||||||
|
<td>
|
||||||
|
<?php echo $this->pagination->getRowOffset( $i ); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $checked; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="<?php echo $link; ?>" title="<?php echo JText::_( 'Edit Application' ); ?>">
|
||||||
|
<?php echo $row->title; ?></a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $row->path; ?>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $published; ?>
|
||||||
|
</td>
|
||||||
|
<!--td align="center">
|
||||||
|
<?php echo $accesslevel; ?>
|
||||||
|
</td-->
|
||||||
|
<td align="center">
|
||||||
|
<?php echo $row->id; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$k = 1 - $k;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tfoot>
|
||||||
|
<td colspan="8">
|
||||||
|
<?php echo $this->pagination->getListFooter(); ?>
|
||||||
|
</td>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="" />
|
||||||
|
<input type="hidden" name="option" value="com_jumi" />
|
||||||
|
<input type="hidden" name="controller" value="application" />
|
||||||
|
<input type="hidden" name="boxchecked" value="0" />
|
||||||
|
<input type="hidden" name="filter_order" value="<?php echo $this->filter->filter_order; ?>" />
|
||||||
|
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter->filter_order_Dir; ?>" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="adminlist" style="width: 100%;margin-top: 12px;"><tr>
|
||||||
|
<td align="center" valign="middle" id="jumi_td" style="">
|
||||||
|
<a href="http://2glux.com/projects/jumi" style="font-size: 12px;" target="_blank">Jumi</a> developed by <a href="http://2glux.com" target="_blank">2GLux.com</a>
|
||||||
|
<div style="position: absolute;right: 2px;top: 7px;">
|
||||||
|
<a href="http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/1023" target="_blank" id="jumi_rate" class="jumi_bottom_icon" title="If you like Jumi, Rate Us PLEASE"> </a>
|
||||||
|
<a href="http://2glux.com/projects/jumi" target="_blank" id="jumi_homepage" style="margin: 0 2px 0 0px;" class="jumi_bottom_icon" title="Project Homepage"> </a>
|
||||||
|
<a href="http://2glux.com" target="_blank" id="jumi_developer" class="jumi_bottom_icon" title="2GLux Company"> </a>
|
||||||
|
<a href="http://2glux.com/forum/jumi/" target="_blank" id="jumi_support" class="jumi_bottom_icon" title="Support Forum"> </a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr></table>
|
||||||
|
<?php }?>
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Joomla! 1.5 component sexy_polling
|
||||||
|
*
|
||||||
|
* @version $Id: view.html.php 2012-04-05 14:30:25 svn $
|
||||||
|
* @author Edvard Ananyan
|
||||||
|
* @package Joomla
|
||||||
|
* @subpackage sexypolling
|
||||||
|
* @license GNU/GPL
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import Joomla! libraries
|
||||||
|
jimport( 'joomla.application.component.view');
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiViewshowApplications extends JView {
|
||||||
|
function display($tpl = null) {
|
||||||
|
|
||||||
|
//toolbar
|
||||||
|
JToolBarHelper::publishList();
|
||||||
|
JToolBarHelper::unpublishList();
|
||||||
|
JToolBarHelper::addNew();
|
||||||
|
JToolBarHelper::editList();
|
||||||
|
JToolBarHelper::deleteList();
|
||||||
|
JToolBarHelper::help( 'screen.applications' );
|
||||||
|
|
||||||
|
// Get data from the model
|
||||||
|
$items = $this->get( 'Data');
|
||||||
|
$filter = $this->get('Filter');
|
||||||
|
$pagination = $this->get('Pagination');
|
||||||
|
|
||||||
|
$this->assignRef( 'items', $items );
|
||||||
|
$this->assignRef('filter', $filter);
|
||||||
|
$this->assignRef('pagination', $pagination);
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiViewshowApplications extends JViewLegacy {
|
||||||
|
function display($tpl = null) {
|
||||||
|
|
||||||
|
//toolbar
|
||||||
|
JToolBarHelper::publishList();
|
||||||
|
JToolBarHelper::unpublishList();
|
||||||
|
JToolBarHelper::addNew();
|
||||||
|
JToolBarHelper::editList();
|
||||||
|
JToolBarHelper::deleteList();
|
||||||
|
JToolBarHelper::help( 'screen.applications' );
|
||||||
|
|
||||||
|
// Get data from the model
|
||||||
|
$items = $this->get( 'Data');
|
||||||
|
$filter = $this->get('Filter');
|
||||||
|
$pagination = $this->get('Pagination');
|
||||||
|
|
||||||
|
$this->assignRef( 'items', $items );
|
||||||
|
$this->assignRef('filter', $filter);
|
||||||
|
$this->assignRef('pagination', $pagination);
|
||||||
|
|
||||||
|
JHtmlSidebar::addFilter(
|
||||||
|
JText::_('JOPTION_SELECT_PUBLISHED'),
|
||||||
|
'filter_published',
|
||||||
|
@JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->filter->published, true)
|
||||||
|
);
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of fields the table can be sorted by
|
||||||
|
*
|
||||||
|
* @return array Array containing the field name to sort by as the key and display text as value
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
*/
|
||||||
|
protected function getSortFields()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'm.published' => JText::_('JSTATUS'),
|
||||||
|
'm.title' => JText::_('JGLOBAL_TITLE'),
|
||||||
|
'm.path' => JText::_('Path'),
|
||||||
|
'm.id' => JText::_('Id'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
63
deployed/jumi/components/com_jumi/controller.php
Normal file
63
deployed/jumi/components/com_jumi/controller.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.application.component.controller');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jumi Component Controller
|
||||||
|
*
|
||||||
|
* @package Joomla.Site
|
||||||
|
* @subpackage com_jumi
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiController extends JController {
|
||||||
|
/**
|
||||||
|
* Method to display a view.
|
||||||
|
*
|
||||||
|
* @param boolean If true, the view output will be cached
|
||||||
|
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||||
|
*
|
||||||
|
* @return JController This object to support chaining.
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
public function display($cachable = false, $urlparams = false) {
|
||||||
|
// Set the default view name and format from the Request.
|
||||||
|
JRequest::setVar('view', 'application');
|
||||||
|
|
||||||
|
parent::display();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiController extends JControllerLegacy {
|
||||||
|
/**
|
||||||
|
* Method to display a view.
|
||||||
|
*
|
||||||
|
* @param boolean If true, the view output will be cached
|
||||||
|
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||||
|
*
|
||||||
|
* @return JController This object to support chaining.
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
public function display($cachable = false, $urlparams = false) {
|
||||||
|
// Set the default view name and format from the Request.
|
||||||
|
JRequest::setVar('view', 'application');
|
||||||
|
|
||||||
|
parent::display();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
101
deployed/jumi/components/com_jumi/files/blogger.php
Normal file
101
deployed/jumi/components/com_jumi/files/blogger.php
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
$blogId = isset($blogId) ? $blogId : '1748567850225926498';
|
||||||
|
$login = isset($login) ? $login : 'joomla-jumi';
|
||||||
|
$cacheTime = isset($cacheTime) ? (int)$cacheTime : 86400;
|
||||||
|
|
||||||
|
$myBlog = new blog($blogId, $login, $cacheTime);
|
||||||
|
$myBlog->printAllPosts();
|
||||||
|
|
||||||
|
echo '<style type="text/css">
|
||||||
|
.post {margin:0 0 1.5em;font-family:Verdana,sans-serif;color:#000000;}
|
||||||
|
.post div {margin:0 0 .75em;line-height:1.3em;}
|
||||||
|
.post img {padding:4px;border:1px solid #cccccc;}
|
||||||
|
.post blockquote {margin:1em 20px;}
|
||||||
|
.post blockquote p {margin:.75em 0;}
|
||||||
|
.date-header {margin:1.5em 0 0;font-weight:normal;color:#999999;font-size:100%;}
|
||||||
|
.post-title {margin:0;padding:0;font-size:110%;font-weight:bold;line-height:1.1em;}
|
||||||
|
.post-title a, .post-title a:visited, .post-title strong {text-decoration:none;color:#333333;font-weight:bold;}
|
||||||
|
.post-footer {color:#333333;font-size:87%;}
|
||||||
|
.post-footer .span {margin-right:.3em;}
|
||||||
|
</style>';
|
||||||
|
|
||||||
|
class blog {
|
||||||
|
var $id;
|
||||||
|
var $login;
|
||||||
|
var $posts;
|
||||||
|
var $cacheTime;
|
||||||
|
|
||||||
|
function __construct($id, $login, $cacheTime) {
|
||||||
|
$this->id = $id;
|
||||||
|
$this->login = $login;
|
||||||
|
$this->cacheTime = $cacheTime;
|
||||||
|
$postsURL = 'http://www.blogger.com/feeds/'.$id.'/posts/default';
|
||||||
|
$fileName = 'cache/'.md5($postsURL);
|
||||||
|
if(file_exists($fileName) and time() - filemtime($fileName) < $this->cacheTime) {
|
||||||
|
$this->posts = simplexml_load_string(file_get_contents($fileName));
|
||||||
|
} else {
|
||||||
|
$feed = file_get_contents($postsURL);
|
||||||
|
if(strlen($feed) > 1000) {
|
||||||
|
file_put_contents($fileName, $feed);
|
||||||
|
$this->posts = simplexml_load_string($feed);
|
||||||
|
} else {
|
||||||
|
$this->posts = simplexml_load_string(file_get_contents($fileName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function blog($id, $login, $cacheTime) {
|
||||||
|
$this->__construct($id, $login, $cacheTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
function printAllPosts() {
|
||||||
|
echo '<div class="blog-posts">';
|
||||||
|
$prev_date = '';
|
||||||
|
foreach ($this->posts->entry as $entry) {
|
||||||
|
for ($i = 0; $i < 5; $i++)
|
||||||
|
$entry->link[$i] = $entry->link[$i]->attributes();
|
||||||
|
if($prev_date != date('l, F j, Y', strtotime($entry->published))) {
|
||||||
|
echo '<h2 class="date-header">'.date('l, F j, Y', strtotime($entry->published)).'</h2>';
|
||||||
|
$prev_date = date('l, F j, Y', strtotime($entry->published));
|
||||||
|
}
|
||||||
|
echo '<div class="post">';
|
||||||
|
echo '<h3 class="post-title"><a href="'.$entry->link[0]['href'].'">'.$entry->title.'</a></h3>';
|
||||||
|
echo '<div class="post-header-line-1"></div>';
|
||||||
|
echo '<div class="post-body">'.$entry->content.'</div>';
|
||||||
|
echo '<div class="post-footer">';
|
||||||
|
echo '<div class="post-footer-line-1">';
|
||||||
|
echo '<span class="post-author">Posted by '.$entry->author->name.'</span> ';
|
||||||
|
echo '<span class="post-timestamp">at <a href="'.$entry->link[0]['href'].'">'.date('H:i', strtotime($entry->published)).'</a></span> ';
|
||||||
|
echo '<span class="post-comment-link"><a title="View or Add Comments" onclick="javascript:window.open(this.href,\'bloggerPopup\',\'toolbar=0,location=0,statusbar=1,menubar=0,scrollbars=yes,width=400,height=450\');return false;" href="'.str_replace('&', '&', $entry->link[1]['href']).'" class="comment-link">'.$entry->link[1]['title'].'</a></span> ';
|
||||||
|
echo '</div>';
|
||||||
|
$labels = '';
|
||||||
|
if(isset($entry->category)) {
|
||||||
|
$labels = 'Labels: ';
|
||||||
|
for ($i = 0; isset($entry->category[$i]); $i++) {
|
||||||
|
$entry->category[$i] = $entry->category[$i]->attributes();
|
||||||
|
$labels .= '<a href="http://'.$this->login.'.blogspot.com/search/label/'.$entry->category[$i]['term'].'">'.$entry->category[$i]['term'].'</a>';
|
||||||
|
if (isset($entry->category[$i+1]))
|
||||||
|
$labels .= ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo '<div class="post-footer-line-2"><span class="post-labels">'.$labels.'</span></div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
echo '</div>';
|
||||||
|
echo '<small>Last updated: '.date('j M, Y H:i', filemtime('cache/'.md5('http://www.blogger.com/feeds/'.$this->id.'/posts/default'))).'</small>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function printComments($postId) { echo ''; }
|
||||||
|
|
||||||
|
function getPostId($id) { return substr($id, -19); }
|
||||||
|
}
|
||||||
1
deployed/jumi/components/com_jumi/files/index.html
Normal file
1
deployed/jumi/components/com_jumi/files/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
1
deployed/jumi/components/com_jumi/index.html
Normal file
1
deployed/jumi/components/com_jumi/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
29
deployed/jumi/components/com_jumi/jumi.php
Normal file
29
deployed/jumi/components/com_jumi/jumi.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
require_once JPATH_COMPONENT . '/router.php';
|
||||||
|
|
||||||
|
if(!defined('DS')){
|
||||||
|
define('DS',DIRECTORY_SEPARATOR);
|
||||||
|
}
|
||||||
|
define('JV', (version_compare(JVERSION, '3', 'l')) ? 'j2' : 'j3');
|
||||||
|
|
||||||
|
jimport('joomla.application.component.controller');
|
||||||
|
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
$controller = JController::getInstance('Jumi');
|
||||||
|
$controller->execute(JRequest::getCmd('task'));
|
||||||
|
$controller->redirect();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
$controller = JControllerLegacy::getInstance('Jumi');
|
||||||
|
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||||
|
$controller->redirect();
|
||||||
|
}
|
||||||
27
deployed/jumi/components/com_jumi/release_notes.txt
Normal file
27
deployed/jumi/components/com_jumi/release_notes.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Jumi package for Joomla 1.5
|
||||||
|
Developer's web pages: http://edo.webmaster.am
|
||||||
|
Downloads and guides: http://jumi.vedeme.cz
|
||||||
|
Tips and tricks: http://edo.webmaster.am/jumi
|
||||||
|
================================
|
||||||
|
Version 2.0.6
|
||||||
|
Release date: 2009/10/17
|
||||||
|
================================
|
||||||
|
This package contains the following extensions:
|
||||||
|
- Jumi component
|
||||||
|
- Jumi content plugin
|
||||||
|
- Jumi system router plugin
|
||||||
|
- Jumi module
|
||||||
|
|
||||||
|
Installation/uninstallation instructions:
|
||||||
|
Install Jumi package as a standard Joomla! extension. All extensions contained in the package are installed automatically.
|
||||||
|
Uninstallation of Jumi component also uninstalls all other Jumi extensions (Jumi module and both Jumi plugins).
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Fixed: links
|
||||||
|
================================
|
||||||
|
Demo
|
||||||
|
There are several demos there. All of them are installed automatically. Any one is accessible by any Jumi extension.
|
||||||
|
Component demo: there are two component demos in Jumi table of your Joomla! database. The first one, Hello Jumi!, is automatically assign the main menu item. The second one, Blogspot, can be accessed through the previous demo or you can assign to it a menu item manually - by a standard Joomla! manner.
|
||||||
|
Module demo file: modules/mod_jumi/jumi_demo.php
|
||||||
|
Plugin demo file: plugins/system/jumi/jumi_demo.php
|
||||||
|
================================
|
||||||
30
deployed/jumi/components/com_jumi/router.php
Normal file
30
deployed/jumi/components/com_jumi/router.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
function JumiBuildRoute(&$query) {
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
$segments = array();
|
||||||
|
|
||||||
|
if(isset($query['fileid'])) {
|
||||||
|
$db->setQuery('select alias from #__jumi where id = '.$query['fileid']);
|
||||||
|
$segments[] = $db->loadResult();
|
||||||
|
unset($query['fileid']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $segments;
|
||||||
|
}
|
||||||
|
|
||||||
|
function JumiParseRoute($segments) {
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
$vars = array();
|
||||||
|
|
||||||
|
$db->setQuery('select id from #__jumi where alias = "'.$segments[0].'"');
|
||||||
|
$vars['fileid'] = $db->loadResult();
|
||||||
|
|
||||||
|
return $vars;
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<metadata>
|
||||||
|
<view title="Application">
|
||||||
|
<message>Displays Jumi application.</message>
|
||||||
|
</view>
|
||||||
|
</metadata>
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<metadata>
|
||||||
|
<layout title="Application">
|
||||||
|
<message>Displays Jumi application.</message>
|
||||||
|
</layout>
|
||||||
|
|
||||||
|
<fields name="request">
|
||||||
|
<fieldset name="request">
|
||||||
|
<field name="fileid" type="sql" query="SELECT id, title FROM #__jumi" key_field="id" value_field="title" description="Select Jumi Application to be included" label="Jumi Application" required="true" />
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</metadata>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.application.component.view');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTML Contact View class for the Contact component
|
||||||
|
*
|
||||||
|
* @package Joomla.Site
|
||||||
|
* @subpackage com_contact
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
if(JV == 'j2') {
|
||||||
|
//j2 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiViewApplication extends JView {
|
||||||
|
function display($tpl = null) {
|
||||||
|
// Initialise variables.
|
||||||
|
$fileid = JRequest::getInt('fileid');
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
//$database->setQuery("select * from #__jumi where id = '{$fileid}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select * from #__jumi where id = '{$fileid}' and published = 1");
|
||||||
|
$appl = $database->loadObject();
|
||||||
|
|
||||||
|
if(!is_object($appl))
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::_("The Jumi Application is Unpublished or Removed").'</div>';
|
||||||
|
|
||||||
|
$document->setTitle($appl->title);
|
||||||
|
|
||||||
|
eval('?>'.$appl->custom_script);
|
||||||
|
|
||||||
|
if(!empty($appl->path)) {
|
||||||
|
$filepath = JPATH_BASE.DS.$appl->path;
|
||||||
|
if(is_file($appl->path)) {
|
||||||
|
require($appl->path);
|
||||||
|
}
|
||||||
|
elseif(is_file($filepath))
|
||||||
|
require $filepath;
|
||||||
|
else
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">The file '.$filepath.' does not exists.</div>';
|
||||||
|
}
|
||||||
|
echo $noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//j3 stuff here///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class JumiViewApplication extends JViewLegacy {
|
||||||
|
function display($tpl = null) {
|
||||||
|
// Initialise variables.
|
||||||
|
$fileid = JRequest::getInt('fileid');
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
//$database->setQuery("select * from #__jumi where id = '{$fileid}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select * from #__jumi where id = '{$fileid}' and published = 1");
|
||||||
|
$appl = $database->loadObject();
|
||||||
|
|
||||||
|
if(!is_object($appl))
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::_("The Jumi Application is Unpublished or Removed").'</div>';
|
||||||
|
|
||||||
|
$document->setTitle($appl->title);
|
||||||
|
|
||||||
|
eval('?>'.$appl->custom_script);
|
||||||
|
|
||||||
|
if(!empty($appl->path)) {
|
||||||
|
$filepath = JPATH_BASE.DS.$appl->path;
|
||||||
|
if(is_file($appl->path)) {
|
||||||
|
require($appl->path);
|
||||||
|
}
|
||||||
|
elseif(is_file($filepath))
|
||||||
|
require $filepath;
|
||||||
|
else
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">The file '.$filepath.' does not exists.</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
deployed/jumi/components/com_jumi/views/index.html
Normal file
1
deployed/jumi/components/com_jumi/views/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
40
deployed/jumi/modules/mod_jumi/helper.php
Normal file
40
deployed/jumi/modules/mod_jumi/helper.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
|
||||||
|
|
||||||
|
class modJumiHelper {
|
||||||
|
function getCodeWritten(&$params) { //returns code written or ""
|
||||||
|
return trim($params->get( 'code_written' ));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStorageSource(&$params) { //returns filepathname or a record id or ""
|
||||||
|
$storage=trim($params->get('source_code_storage'));
|
||||||
|
if($storage!="") {
|
||||||
|
if($id = substr(strchr($storage,"*"),1)) { //if record id return it
|
||||||
|
return (int)$id;
|
||||||
|
}
|
||||||
|
else { // else return filepathname
|
||||||
|
return $params->def('default_absolute_path',JPATH_ROOT).DS.$storage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCodeStored($source) { //returns code stored in the database or null.
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
//$user = &JFactory::getUser();
|
||||||
|
//$database->setQuery("select custom_script from #__jumi where id = '{$source}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select custom_script from #__jumi where id = $source");
|
||||||
|
return $database->loadResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
1
deployed/jumi/modules/mod_jumi/index.html
Normal file
1
deployed/jumi/modules/mod_jumi/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
16
deployed/jumi/modules/mod_jumi/jumi_demo.php
Normal file
16
deployed/jumi/modules/mod_jumi/jumi_demo.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<p><strong>Hello in the world of Jumi!</strong></p>
|
||||||
|
<p>This is the default Jumi demo file presented on <b><?php echo JURI::base(); ?></b>.</p>
|
||||||
|
<p>Jumi is a set of custom code extensions for CMS Joomla! Jumi comes as a component, a plugin and a module.</p>
|
||||||
|
<p>Jumi brings you sufficient power, flexibility and simplicity for quick development and reliable operation of your applications running under Joomla!</p>
|
||||||
|
<p>Jumi resources: <a href="http://edo.webmaster.am/jumi">Downloads & guides</a>, <a href="http://edo.webmaster.am/jumi/tutorial">Tips & tricks</a>.</p>
|
||||||
23
deployed/jumi/modules/mod_jumi/mod_jumi.php
Normal file
23
deployed/jumi/modules/mod_jumi/mod_jumi.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
if(!defined('DS')){
|
||||||
|
define('DS',DIRECTORY_SEPARATOR);
|
||||||
|
}
|
||||||
|
// Include the functions only once
|
||||||
|
require_once(dirname(__FILE__).DS.'helper.php');
|
||||||
|
|
||||||
|
$code_written = modJumiHelper::getCodeWritten($params); //code written or ""
|
||||||
|
$storage_source = modJumiHelper::getStorageSource($params); //filepathname or record id or ""
|
||||||
|
|
||||||
|
if(is_int($storage_source)) { //it is record id
|
||||||
|
$code_stored = modJumiHelper::getCodeStored($storage_source); //code or null(error]
|
||||||
|
}
|
||||||
|
|
||||||
|
require(JModuleHelper::getLayoutPath('mod_jumi'));
|
||||||
51
deployed/jumi/modules/mod_jumi/mod_jumi.xml
Normal file
51
deployed/jumi/modules/mod_jumi/mod_jumi.xml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="module" version="1.6.0" method="upgrade">
|
||||||
|
<name>Jumi</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (c) 2006 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||||
|
<authorEmail>info@2glux.com</authorEmail>
|
||||||
|
<authorUrl>http://2glux.com</authorUrl>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
<description>MOD_JUMI_DESC</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename module="mod_jumi">mod_jumi.php</filename>
|
||||||
|
<filename>index.html</filename>
|
||||||
|
<filename>helper.php</filename>
|
||||||
|
<filename>jumi_demo.php</filename>
|
||||||
|
<filename>tmpl/default.php</filename>
|
||||||
|
<filename>tmpl/index.html</filename>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<languages folder="language">
|
||||||
|
<language tag="en-GB">en-GB/en-GB.mod_jumi.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.mod_jumi.ini</language>
|
||||||
|
<language tag="cs-CZ">cs-CZ/cs-CZ.mod_jumi.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.mod_jumi.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.mod_jumi.ini</language>
|
||||||
|
</languages>
|
||||||
|
|
||||||
|
<config>
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic">
|
||||||
|
<field name="notepad" type="textarea" default="" label="Notepad" description="PARAMNOTES" cols="60" rows="3" />
|
||||||
|
<field name="@spacer" type="spacer" default="" label="" description="" />
|
||||||
|
<field name="code_written" type="textarea" default="" label="Code written" description="PARAMCODEWRITTEN" cols="60" rows="17" />
|
||||||
|
<field name="@spacer" type="spacer" default="" label="" description="" />
|
||||||
|
<field name="source_code_storage" type="text" size ="97" default="" label="Source of code" description="PARAMSOURCECODESTORAGE" />
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="advanced">
|
||||||
|
<field name="default_absolute_path" type="text" size ="90" default="" label="Default Absolute Jumi Path" description="PARAMABSPATH" />
|
||||||
|
<field name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" />
|
||||||
|
<field name="cache" type="list" default="1" label="Caching" description="PARAMMODULECACHING">
|
||||||
|
<option value="1">Use global</option>
|
||||||
|
<option value="0">No caching</option>
|
||||||
|
</field>
|
||||||
|
<field name="cache_time" type="text" default="900" label="Cache Time" description="PARAMMODULECACHETIME" />
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
33
deployed/jumi/modules/mod_jumi/tmpl/default.php
Normal file
33
deployed/jumi/modules/mod_jumi/tmpl/default.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
if($code_written.$storage_source != '') { //something to show
|
||||||
|
if($code_written != '') //if code written
|
||||||
|
eval ('?>'.$code_written); //include custom script written
|
||||||
|
|
||||||
|
if($storage_source != '') { // if record id or filepathname
|
||||||
|
if(is_int($storage_source)) { //it is record id
|
||||||
|
if($code_stored != null) {
|
||||||
|
eval ('?>'.$code_stored); //include custom script written
|
||||||
|
} else {
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_RECORD', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
} else { //it is file
|
||||||
|
if(is_readable($storage_source)) {
|
||||||
|
include($storage_source); //include file
|
||||||
|
} else {
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_FILE', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { //nothing to show
|
||||||
|
echo '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_CONTENT').'</div>';
|
||||||
|
}
|
||||||
|
echo $noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
1
deployed/jumi/modules/mod_jumi/tmpl/index.html
Normal file
1
deployed/jumi/modules/mod_jumi/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
130
deployed/jumi/plugins/system/jumi/jumi.php
Normal file
130
deployed/jumi/plugins/system/jumi/jumi.php
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// Import library dependencies
|
||||||
|
jimport('joomla.plugin.plugin');
|
||||||
|
jimport('joomla.event.plugin');
|
||||||
|
|
||||||
|
class plgSystemJumi extends JPlugin {
|
||||||
|
function __construct( &$subject ) {
|
||||||
|
parent::__construct( $subject );
|
||||||
|
// load plugin parameters and language file
|
||||||
|
$this->_plugin = JPluginHelper::getPlugin( 'system', 'jumi' );
|
||||||
|
$this->_params = json_decode( $this->_plugin->params );
|
||||||
|
JPlugin::loadLanguage('plg_system_jumi', JPATH_ADMINISTRATOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAfterRender() {
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
if($mainframe->isAdmin())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$plugin = JPluginHelper::getPlugin('system', 'jumi');
|
||||||
|
$pluginParams = json_decode( $plugin->params );
|
||||||
|
|
||||||
|
$content = JResponse::getBody();
|
||||||
|
|
||||||
|
//print_r($pluginParams);exit;
|
||||||
|
|
||||||
|
// expression to search for
|
||||||
|
$regex = '/{(jumi)\s*(.*?)}/i'; //BUG: des not work with written codes containing
|
||||||
|
// if hide_code then replace jumi syntax codes with an empty string
|
||||||
|
if ( $pluginParams->hide_code == 1 ) {
|
||||||
|
$content = preg_replace( $regex, '', $content );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$continuesearching = true;
|
||||||
|
while ($continuesearching){ //Nesting loop
|
||||||
|
// find all instances of $regex (i.e. jumi) in an article and put them in $matches
|
||||||
|
$matches = array();
|
||||||
|
$matches_found = preg_match_all( $regex, $content, $matches, PREG_SET_ORDER );
|
||||||
|
if ($matches_found) {
|
||||||
|
// cycle through all jumi instancies. Put text into $dummy[2]
|
||||||
|
foreach ($matches as $dummy) {
|
||||||
|
//read arguments contained in [] from $dummy[2] and put them into the array $jumi
|
||||||
|
$mms=array();
|
||||||
|
$jumi="";
|
||||||
|
preg_match_all('/\[.*?\]/', $dummy[2], $mms);
|
||||||
|
if ($mms) { //at the least one argument found
|
||||||
|
foreach ($mms as $i=>$mm) {
|
||||||
|
$jumi = preg_replace("/\[|]/", "", $mm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Following syntax {jumi [storage_source][arg1]...[argN]}
|
||||||
|
$storage_source = $this->getStorageSource(trim(array_shift($jumi)), $pluginParams->default_absolute_path); //filepathname or record id or ""
|
||||||
|
$output = ''; // Jumi output
|
||||||
|
|
||||||
|
if($storage_source == '') { //if nothing to show
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::_('ERROR_CONTENT').'</div>';
|
||||||
|
} else { // buffer output
|
||||||
|
ob_start();
|
||||||
|
if(is_int($storage_source)){ //it is record id
|
||||||
|
$code_stored = $this->getCodeStored($storage_source);
|
||||||
|
if($code_stored != null){ //include custom script written
|
||||||
|
eval ('?>'.$code_stored);
|
||||||
|
} else {
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_RECORD', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
} else { //it is file
|
||||||
|
if(is_readable($storage_source)) {
|
||||||
|
include($storage_source); //include file
|
||||||
|
} else {
|
||||||
|
$output = '<div style="color:#FF0000;background:#FFFF00;">'.JText::sprintf('ERROR_FILE', $storage_source).'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($output == ''){ //if there are no errors
|
||||||
|
//$output = str_replace( '$' , '\$' , ob_get_contents()); fixed joomla bug
|
||||||
|
$output = ob_get_contents();
|
||||||
|
}
|
||||||
|
ob_end_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
// final replacement of $regex (i.e. {jumi [][]}) in $article->text by $output
|
||||||
|
$content = preg_replace($regex, $output, $content, 1);
|
||||||
|
}
|
||||||
|
if ($pluginParams->nested_replace == 0) {
|
||||||
|
$continuesearching = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$continuesearching = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$noscript = '<noscript><strong>JavaScript is currently disabled.</strong>Please enable it for a better experience of <a href="http://2glux.com/projects/jumi">Jumi</a>.</noscript>';
|
||||||
|
$content = str_replace('</body>', $noscript . '</body>', $content);
|
||||||
|
JResponse::setBody($content);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCodeStored($source) { //returns code stored in the database or null.
|
||||||
|
$database = JFactory::getDBO();
|
||||||
|
//$user = &JFactory::getUser();
|
||||||
|
//$database->setQuery("select custom_script from #__jumi where id = '{$source}' and access <= {$user->gid} and published = 1");
|
||||||
|
$database->setQuery("select custom_script from #__jumi where id = $source");
|
||||||
|
return $database->loadResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStorageSource($source, $abspath) { //returns filepathname or a record id or ""
|
||||||
|
$storage=trim($source);
|
||||||
|
if ($storage!=""){
|
||||||
|
if ($id = substr(strchr($storage,"*"),1)) { //if record id return it
|
||||||
|
return (int)$id;
|
||||||
|
} else { // else return filepathname
|
||||||
|
if($abspath == '')
|
||||||
|
return $storage;
|
||||||
|
else
|
||||||
|
return $abspath.DS.$storage;
|
||||||
|
}
|
||||||
|
} else { // else return ""
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
42
deployed/jumi/plugins/system/jumi/jumi.xml
Normal file
42
deployed/jumi/plugins/system/jumi/jumi.xml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="plugin" group="system" version="2.5" method="upgrade">
|
||||||
|
<name>System - Jumi</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (c) 2006 - 2010 Martin Hajek, 2011 - 2015 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||||
|
<authorEmail>info@2glux.com</authorEmail>
|
||||||
|
<authorUrl>http://2glux.com</authorUrl>
|
||||||
|
<version>3.0.4</version>
|
||||||
|
<description>JUMIPLUGINDESC</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename plugin="jumi">jumi.php</filename>
|
||||||
|
<filename>jumi/jumi_demo.php</filename>
|
||||||
|
<filename>jumi/index.html</filename>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<languages folder="language">
|
||||||
|
<language tag="en-GB">en-GB/en-GB.plg_system_jumi.ini</language>
|
||||||
|
<language tag="ru-RU">ru-RU/ru-RU.plg_content_jumi.ini</language>
|
||||||
|
<language tag="cs-CZ">cs-CZ/cs-CZ.plg_content_jumi.ini</language>
|
||||||
|
<language tag="hy-AM">hy-AM/hy-AM.plg_content_jumi.ini</language>
|
||||||
|
<language tag="es-ES">es-ES/es-ES.plg_content_jumi.ini</language>
|
||||||
|
</languages>
|
||||||
|
|
||||||
|
<config>
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic">
|
||||||
|
<field name="default_absolute_path" type="text" size ="80" default="" label="Default Absolute Jumi Path" description="PARAMABSPATH" />
|
||||||
|
<field name="hide_code" type="radio" default="0" label="Hide Jumi code" description="PARAMHIDECODE">
|
||||||
|
<option value="0">No</option>
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
</field>
|
||||||
|
<field name="nested_replace" type="radio" default="0" label="Nested replace" description="PARAMNESTED">
|
||||||
|
<option value="0">No</option>
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
1
deployed/jumi/plugins/system/jumi/jumi/index.html
Normal file
1
deployed/jumi/plugins/system/jumi/jumi/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
28
deployed/jumi/plugins/system/jumi/jumi/jumi_demo.php
Normal file
28
deployed/jumi/plugins/system/jumi/jumi/jumi_demo.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2010 Martin Hajek, 2011 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
<p><strong>Hello in the world of Jumi!</strong></p>
|
||||||
|
<p>This is the default Jumi demo file.</p>
|
||||||
|
<p>Your current content of $jumi[] array is:</p>
|
||||||
|
<?php
|
||||||
|
if (!empty($jumi)){
|
||||||
|
echo "<ul>\n";
|
||||||
|
foreach ($jumi as $key => $value) {
|
||||||
|
echo '<li>$jumi['.$key.'] = '.$value.'</li>';
|
||||||
|
}
|
||||||
|
echo "</ul>\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<p>empty</p>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p>Jumi is a set of custom code extensions for CMS Joomla! Jumi comes as a component, a plugin and a module.</p>
|
||||||
|
<p>Jumi brings you sufficient power, flexibility and simplicity for quick development and reliable operation of your applications running under Joomla!</p>
|
||||||
|
<p>Jumi resources: <a href="http://edo.webmaster.am/jumi">Downloads & guides</a>, <a href="http://edo.webmaster.am/jumi/tutorial">Tips & tricks</a>.</p>
|
||||||
76
deployed/jumi/plugins/system/jumirouter/jumirouter.php
Normal file
76
deployed/jumi/plugins/system/jumirouter/jumirouter.php
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @version $Id$
|
||||||
|
* @package Jumi
|
||||||
|
* @copyright (C) 2008 - 2015 Edvard Ananyan
|
||||||
|
* @license GNU/GPL v3 http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport( 'joomla.plugin.plugin' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JumiRouter plugin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class plgSystemJumiRouter extends JPlugin {
|
||||||
|
function __construct(& $subject, $config) {
|
||||||
|
// check to see if we are on frontend to execute plugin
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
if($mainframe->isAdmin())
|
||||||
|
return;
|
||||||
|
|
||||||
|
parent::__construct($subject, $config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routes URLs
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function onAfterInitialise() {
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
|
||||||
|
$uri = JURI::getInstance();
|
||||||
|
$router = $mainframe->getRouter();
|
||||||
|
|
||||||
|
$router->attachParseRule('parseJumiRouter');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SEF url parser
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @static
|
||||||
|
* @param $router object of JRouter class
|
||||||
|
* @param $uri object of JURI class
|
||||||
|
*/
|
||||||
|
function parseJumiRouter(& $router, & $uri) {
|
||||||
|
if($router->getMode() == JROUTER_MODE_RAW)
|
||||||
|
return array();
|
||||||
|
|
||||||
|
$db = JFactory::getDBO();
|
||||||
|
$db->setQuery('select id, title, alias from #__jumi where published = 1');
|
||||||
|
$apps = $db->loadRowList();
|
||||||
|
$alias = array();
|
||||||
|
foreach($apps as $i=>$app) {
|
||||||
|
if(empty($app[2]))
|
||||||
|
$apps[$i][2] = JFilterOutput::stringURLSafe($app[1]);
|
||||||
|
$alias[$i] = $apps[$i][2];
|
||||||
|
}
|
||||||
|
|
||||||
|
$segments = explode('/', $uri->getPath());
|
||||||
|
foreach($segments as $i => $segment)
|
||||||
|
if(($j = array_search($segment, $alias)) !== false) {
|
||||||
|
unset($segments[$i]);
|
||||||
|
$uri->setVar('option', 'com_jumi');
|
||||||
|
$uri->setVar('fileid', $apps[$j][0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$uri->setPath(implode('/', $segments));
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
16
deployed/jumi/plugins/system/jumirouter/jumirouter.xml
Normal file
16
deployed/jumi/plugins/system/jumirouter/jumirouter.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension type="plugin" group="system" version="1.6" method="upgrade">
|
||||||
|
<name>System - Jumi Router</name>
|
||||||
|
<author>Edvard Ananyan</author>
|
||||||
|
<creationDate>January 2011</creationDate>
|
||||||
|
<copyright>Copyright (C) 2008 - 2011 Edvard Ananyan. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||||
|
<authorEmail>edo888@gmail.com</authorEmail>
|
||||||
|
<authorUrl>http://edo.webmaster.am</authorUrl>
|
||||||
|
<version>2.0.6</version>
|
||||||
|
<description>SEF routing plugin for Jumi, which will enable direct access to jumi application with it's alias.</description>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<filename plugin="jumirouter">jumirouter.php</filename>
|
||||||
|
</files>
|
||||||
|
</extension>
|
||||||
Loading…
Reference in New Issue
Block a user