添加到 trunk
+YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@324 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Make sure the user is authorized to view this page
|
||||
/*$user = & JFactory::getUser();
|
||||
if (!$user->authorize( 'com_ninjarsssyndicator', 'manage' )) {
|
||||
$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
|
||||
}
|
||||
*/
|
||||
// Require the base controller
|
||||
require_once (JPATH_COMPONENT.DS.'controllers'.DS.'defaultcontroller.php');
|
||||
|
||||
// Require specific controller if requested
|
||||
if($controller = JRequest::getVar('controller')) {
|
||||
require_once (JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php');
|
||||
}
|
||||
//die('shit');
|
||||
// Create the controller
|
||||
$classname = 'NinjaRssSyndicatorController'.$controller;
|
||||
$controller = new $classname( );
|
||||
|
||||
// Perform the Request task
|
||||
$controller->execute( JRequest::getVar('task'));
|
||||
|
||||
// Redirect if set by the controller
|
||||
$controller->redirect();
|
||||
|
||||
?>
|
||||
+1
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 109 B |
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,138 @@
|
||||
// Title: Tigra Color Picker
|
||||
// URL: http://www.softcomplex.com/products/tigra_color_picker/
|
||||
// Version: 1.1
|
||||
// Date: 06/26/2003 (mm/dd/yyyy)
|
||||
// Note: Permission given to use this script in ANY kind of applications if
|
||||
// header lines are left unchanged.
|
||||
// Note: Script consists of two files: picker.js and picker.html
|
||||
//Oct 18 2008: changed line 18: mosUrl+'/picker.html' ==> mosUrl+'assets/picker.html'
|
||||
|
||||
var TCP = new TColorPicker();
|
||||
|
||||
function TCPopup(field, palette) {
|
||||
this.field = field;
|
||||
this.initPalette = !palette || palette > 2 ? 0 : palette;
|
||||
var w = 194, h = 206,
|
||||
move = screen ?
|
||||
',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '',
|
||||
o_colWindow = window.open(mosUrl+'assets/picker.html', null, "help=no,status=no,scrollbars=no,resizable=no" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true);
|
||||
o_colWindow.opener = window;
|
||||
o_colWindow.focus();
|
||||
}
|
||||
|
||||
function TCBuildCell (R, G, B, w, h) {
|
||||
return '<td bgcolor="#' + this.dec2hex((R << 16) + (G << 8) + B) + '"><a href="javascript:P.S(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\');window.opener.renderImage();" onmouseover="P.P(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\')"><img src="'+mosUrl+'pixel.gif" width="' + w + '" height="' + h + '" border="0"></a></td>';
|
||||
}
|
||||
|
||||
function TCSelect(c) {
|
||||
this.field.value = '#' + c.toUpperCase();
|
||||
this.win.close();
|
||||
}
|
||||
|
||||
function TCPaint(c, b_noPref) {
|
||||
c = (b_noPref ? '' : '#') + c.toUpperCase();
|
||||
if (this.o_samp)
|
||||
this.o_samp.innerHTML = '<font face=Tahoma size=2>' + c +' <font color=white>' + c + '</font></font>'
|
||||
if(this.doc.layers)
|
||||
this.sample.bgColor = c;
|
||||
else {
|
||||
if (this.sample.backgroundColor != null) this.sample.backgroundColor = c;
|
||||
else if (this.sample.background != null) this.sample.background = c;
|
||||
}
|
||||
}
|
||||
|
||||
function TCGenerateSafe() {
|
||||
var s = '';
|
||||
for (j = 0; j < 12; j ++) {
|
||||
s += "<tr>";
|
||||
for (k = 0; k < 3; k ++)
|
||||
for (i = 0; i <= 5; i ++)
|
||||
s += this.bldCell(k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, i * 51, 8, 10);
|
||||
s += "</tr>";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function TCGenerateWind() {
|
||||
var s = '';
|
||||
for (j = 0; j < 12; j ++) {
|
||||
s += "<tr>";
|
||||
for (k = 0; k < 3; k ++)
|
||||
for (i = 0; i <= 5; i++)
|
||||
s += this.bldCell(i * 51, k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, 8, 10);
|
||||
s += "</tr>";
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
function TCGenerateGray() {
|
||||
var s = '';
|
||||
for (j = 0; j <= 15; j ++) {
|
||||
s += "<tr>";
|
||||
for (k = 0; k <= 15; k ++) {
|
||||
g = Math.floor((k + j * 16) % 256);
|
||||
s += this.bldCell(g, g, g, 9, 7);
|
||||
}
|
||||
s += '</tr>';
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
function TCDec2Hex(v) {
|
||||
v = v.toString(16);
|
||||
for(; v.length < 6; v = '0' + v);
|
||||
return v;
|
||||
}
|
||||
|
||||
function TCChgMode(v) {
|
||||
for (var k in this.divs) this.hide(k);
|
||||
this.show(v);
|
||||
}
|
||||
|
||||
function TColorPicker(field) {
|
||||
this.build0 = TCGenerateSafe;
|
||||
this.build1 = TCGenerateWind;
|
||||
this.build2 = TCGenerateGray;
|
||||
this.show = document.layers ?
|
||||
function (div) { this.divs[div].visibility = 'show' } :
|
||||
function (div) { this.divs[div].visibility = 'visible' };
|
||||
this.hide = document.layers ?
|
||||
function (div) { this.divs[div].visibility = 'hide' } :
|
||||
function (div) { this.divs[div].visibility = 'hidden' };
|
||||
// event handlers
|
||||
this.C = TCChgMode;
|
||||
this.S = TCSelect;
|
||||
this.P = TCPaint;
|
||||
this.popup = TCPopup;
|
||||
this.draw = TCDraw;
|
||||
this.dec2hex = TCDec2Hex;
|
||||
this.bldCell = TCBuildCell;
|
||||
this.divs = [];
|
||||
}
|
||||
|
||||
function TCDraw(o_win, o_doc) {
|
||||
this.win = o_win;
|
||||
this.doc = o_doc;
|
||||
var
|
||||
s_tag_openT = o_doc.layers ?
|
||||
'layer visibility=hidden top=54 left=5 width=182' :
|
||||
'div style=visibility:hidden;position:absolute;left:6px;top:54px;width:182px;height:0',
|
||||
s_tag_openS = o_doc.layers ? 'layer top=32 left=6' : 'div',
|
||||
s_tag_close = o_doc.layers ? 'layer' : 'div'
|
||||
|
||||
this.doc.write('<' + s_tag_openS + ' id=sam name=sam><table cellpadding=0 cellspacing=0 border=1 width=181 align=center class=bd><tr><td align=center height=18><div id="samp"><font face=Tahoma size=2>sample <font color=white>sample</font></font></div></td></tr></table></' + s_tag_close + '>');
|
||||
this.sample = o_doc.layers ? o_doc.layers['sam'] :
|
||||
o_doc.getElementById ? o_doc.getElementById('sam').style : o_doc.all['sam'].style
|
||||
|
||||
for (var k = 0; k < 3; k ++) {
|
||||
this.doc.write('<' + s_tag_openT + ' id="p' + k + '" name="p' + k + '"><table cellpadding=0 cellspacing=0 border=1 align=center>' + this['build' + k]() + '</table></' + s_tag_close + '>');
|
||||
this.divs[k] = o_doc.layers
|
||||
? o_doc.layers['p' + k] : o_doc.all
|
||||
? o_doc.all['p' + k].style : o_doc.getElementById('p' + k).style
|
||||
}
|
||||
if (!o_doc.layers && o_doc.body.innerHTML)
|
||||
this.o_samp = o_doc.all
|
||||
? o_doc.all.samp : o_doc.getElementById('samp');
|
||||
this.C(this.initPalette);
|
||||
if (this.field.value) this.P(this.field.value, true)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<!--
|
||||
Title: Tigra Color Picker
|
||||
URL: http://www.softcomplex.com/products/tigra_color_picker/
|
||||
Version: 1.1
|
||||
Date: 06/26/2003 (mm/dd/yyyy)
|
||||
Note: Permission given to use this script in ANY kind of applications if
|
||||
header lines are left unchanged.
|
||||
Note: Script consists of two files: picker.js and picker.html
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Tigra Color Picker</title>
|
||||
<style>
|
||||
.bd { border : 1px inset InactiveBorder; }
|
||||
.s { width:181 }
|
||||
</style>
|
||||
</head>
|
||||
<body leftmargin="5" topmargin="5" marginheight="5" marginwidth="5" onload="P.C(P.initPalette)">
|
||||
<form>
|
||||
<table cellpadding=0 cellspacing=2 border=0 width=184>
|
||||
|
||||
<tr><td align="center">
|
||||
<select name="type" onchange="P.C(this.selectedIndex)" class="s">
|
||||
<option>Web Safe Palette</option>
|
||||
<option>Windows System Palette</option>
|
||||
<option>Grey Scale Palette</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td align="center">
|
||||
<script language="JavaScript">
|
||||
var P = opener.TCP;
|
||||
onload = "P.show(P.initPalette)";
|
||||
document.forms[0].elements[0].selectedIndex = P.initPalette;
|
||||
P.draw(window, document);
|
||||
</script>
|
||||
</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<install type="component" version="1.5.0" method="upgrade">
|
||||
<name>Ninja RSS Syndicator</name>
|
||||
<creationDate>2009/15/12</creationDate>
|
||||
<author>Daniel Chapman</author>
|
||||
<authorEmail>[email protected]</authorEmail>
|
||||
<authorUrl>http://ninjaforge.com</authorUrl>
|
||||
<copyright>NinjaForge.com</copyright>
|
||||
<license><![CDATA[ Ninja RSS Syndicator is free software; you can redistribute it and/or modify it under the terms of the <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">General Public License</a> as published by the Free Software Foundation. ]]></license>
|
||||
<version>1.0.7</version>
|
||||
<description></description>
|
||||
<install>
|
||||
<sql>
|
||||
<file charset="utf8" driver="mysql" folder="">install/install.sql</file>
|
||||
</sql>
|
||||
</install>
|
||||
<files folder="site">
|
||||
<filename>index.html</filename>
|
||||
<filename>ninjarsssyndicator.php</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>controllers</folder>
|
||||
<folder>feed</folder>
|
||||
<folder>models</folder>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
<administration>
|
||||
<menu img="components/com_ninjarsssyndicator/assets/images/nficon.png">Ninja RSS Syndicator</menu>
|
||||
<submenu>
|
||||
<menu task="info">Dashboard</menu>
|
||||
<menu task="feeds">Feeds</menu>
|
||||
<menu task="buttonmaker">Button Maker</menu>
|
||||
<menu task="config">Default Settings</menu>
|
||||
</submenu>
|
||||
<files folder="admin">
|
||||
<filename>index.html</filename>
|
||||
<filename>admin.ninjarsssyndicator.php</filename>
|
||||
<folder>controllers</folder>
|
||||
<folder>models</folder>
|
||||
<folder>install</folder>
|
||||
<folder>assets</folder>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
</administration>
|
||||
<installfile>install/install.php</installfile>
|
||||
<uninstallfile>install/uninstall.php</uninstallfile>
|
||||
</install>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
class NinjaRssSyndicatorControllerButtonMaker extends JController
|
||||
{
|
||||
|
||||
var $_link = null;
|
||||
function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
$this->_link = 'index.php?option=com_ninjarsssyndicator&task=buttonmaker';
|
||||
}
|
||||
|
||||
function save()
|
||||
{
|
||||
$model = $this->getModel('buttonmaker');
|
||||
$msg = $model->save($post);
|
||||
$is_ajaxed = isset($_SERVER["HTTP_X_REQUESTED_WITH"]) ? ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest") : false;
|
||||
if($is_ajaxed)
|
||||
exit($msg);
|
||||
$this->setRedirect( $this->_link, $msg );
|
||||
}
|
||||
}
|
||||
?>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
class NinjaRssSyndicatorControllerConfig extends JController
|
||||
{
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function save()
|
||||
{
|
||||
$model = $this->getModel('config');
|
||||
if ($model->saveConfig($post)) {
|
||||
$msg = JText::_( 'Settings Saved!' );
|
||||
} else {
|
||||
$msg = JText::_( 'Error Saving Settings' );
|
||||
}
|
||||
|
||||
// Check the table in so it can be edited.... we are done with it anyway
|
||||
$link = 'index.php?option=com_ninjarsssyndicator&task=config';
|
||||
$this->setRedirect($link, $msg);
|
||||
}
|
||||
}
|
||||
?>
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
class NinjaRssSyndicatorController extends JController
|
||||
{
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->registerTask('info', 'info');
|
||||
$this->registerTask('buttonmaker', 'buttonmaker');
|
||||
$this->registerTask('genbtn', 'gen_button');
|
||||
$this->registerTask('config', 'config');
|
||||
$this->registerTask('feeds', 'feeds');
|
||||
$this->registerDefaultTask('feeds');
|
||||
}
|
||||
|
||||
function display()
|
||||
{
|
||||
parent::display();
|
||||
}
|
||||
|
||||
function info()
|
||||
{
|
||||
require_once(JPATH_COMPONENT . DS . 'views' . DS . 'about.php');
|
||||
new NinjaRssSyndicatorViewAbout();
|
||||
}
|
||||
|
||||
function buttonmaker()
|
||||
{
|
||||
|
||||
JRequest::setVar('view','buttonmaker');
|
||||
JRequest::setVar('layout','form');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function config()
|
||||
{
|
||||
JRequest::setVar('view','config');
|
||||
JRequest::setVar('layout','config');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
function feeds()
|
||||
{
|
||||
$document = &JFactory::getDocument();
|
||||
$viewType = $document->getType();
|
||||
$view = &$this->getView('feeds',$viewType,'NinjaRssSyndicatorView');
|
||||
$model = &$this->getModel('feed');
|
||||
if(!JError::isError($model))
|
||||
{
|
||||
$view->setModel($model,true);
|
||||
}
|
||||
$view->setLayout('feeds');
|
||||
$view->display();
|
||||
|
||||
}
|
||||
|
||||
function gen_button()
|
||||
{
|
||||
JRequest::setVar( 'view', 'buttonmaker' );
|
||||
JRequest::setVar( 'layout', 'button' );
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
class NinjaRssSyndicatorControllerFeed extends JController
|
||||
{
|
||||
|
||||
var $_link = null;
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_link = 'index.php?option=com_ninjarsssyndicator&task=feeds';
|
||||
$this->registerTask( 'add' , 'edit' );
|
||||
$this->registerTask( 'apply' , 'save' );
|
||||
}
|
||||
|
||||
function cancel()
|
||||
{
|
||||
//$msg = JText::_( 'Operation Cancelled' );
|
||||
$this->setRedirect( $this->_link );
|
||||
}
|
||||
|
||||
function edit()
|
||||
{
|
||||
|
||||
JRequest::setVar( 'view', 'feed' );
|
||||
JRequest::setVar( 'layout', 'feed' );
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
function save()
|
||||
{
|
||||
$model = $this->getModel('feed');
|
||||
|
||||
if ($model->save($post)) {
|
||||
$msg = JText::_( 'Feed Saved!' );
|
||||
} else {
|
||||
$msg = JText::_( 'Error Saving feed' );
|
||||
}
|
||||
if($this->_task == 'apply')
|
||||
{
|
||||
$id = JRequest::getVar( 'id', '', 'post', 'string' );
|
||||
//die(JRequest::getVar('id' ));
|
||||
$this->_link = "index.php?option=com_ninjarsssyndicator&task=edit&cid[]=$id&controller=feed";
|
||||
}
|
||||
$this->setRedirect( $this->_link, $msg );
|
||||
}
|
||||
|
||||
function publish()
|
||||
{
|
||||
|
||||
// Check for request forgeries
|
||||
JRequest::checkToken() or jexit( 'Invalid Token' );
|
||||
|
||||
$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
|
||||
JArrayHelper::toInteger($cid);
|
||||
|
||||
if (count( $cid ) < 1) {
|
||||
JError::raiseError(500, JText::_( 'Select an item to publish' ) );
|
||||
}
|
||||
|
||||
$model = $this->getModel('feed');
|
||||
if(!$model->publish($cid, 1)) {
|
||||
echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n";
|
||||
}
|
||||
|
||||
$this->setRedirect($this->_link);
|
||||
}
|
||||
|
||||
function unpublish()
|
||||
{
|
||||
|
||||
// Check for request forgeries
|
||||
JRequest::checkToken() or jexit( 'Invalid Token' );
|
||||
|
||||
$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
|
||||
JArrayHelper::toInteger($cid);
|
||||
|
||||
if (count( $cid ) < 1) {
|
||||
JError::raiseError(500, JText::_( 'Select an item to unpublish' ) );
|
||||
}
|
||||
|
||||
$model = $this->getModel('feed');
|
||||
if(!$model->publish($cid, 0)) {
|
||||
echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n";
|
||||
}
|
||||
|
||||
$this->setRedirect($this->_link);
|
||||
}
|
||||
|
||||
function remove()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JRequest::checkToken() or jexit( 'Invalid Token' );
|
||||
|
||||
$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
|
||||
JArrayHelper::toInteger($cid);
|
||||
|
||||
if (count( $cid ) < 1) {
|
||||
JError::raiseError(500, JText::_( 'Select an item to delete' ) );
|
||||
}
|
||||
|
||||
$model = $this->getModel('feed');
|
||||
if(!$model->delete($cid)) {
|
||||
echo "<script> alert('".$model->getError(true)."'); window.history.go(-1); </script>\n";
|
||||
}
|
||||
|
||||
$this->setRedirect($this->_link);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
+1
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
function com_install()
|
||||
{
|
||||
|
||||
$database = & JFactory::getDBO();
|
||||
|
||||
//xipat - vh Feb 09 2009: Change sql query, remove columns: feed_catsInTitle, msg_sectcat; add column: msg_exitems
|
||||
//xipat - vh Oct 28 2008
|
||||
$database->setQuery("ALTER IGNORE TABLE `#__ninjarsssyndicator_feeds` DROP COLUMN `feed_catsInTitle`;");
|
||||
$database->query();
|
||||
$database->setQuery("ALTER IGNORE TABLE `#__ninjarsssyndicator_feeds` CHANGE COLUMN `msg_sectcat` `msg_exitems` varchar(250) default NULL;");
|
||||
$database->query();
|
||||
|
||||
|
||||
//Do updates of table structure if we need to
|
||||
//This is mainly for people doing an upgrade
|
||||
$database->setQuery("SHOW FULL COLUMNS FROM #__ninjarsssyndicator_feeds where field = 'msg_contentPlugins'");
|
||||
$results = $database->loadObjectList();
|
||||
|
||||
if (!count($results))
|
||||
{
|
||||
$database->setQuery(" ALTER TABLE `#__ninjarsssyndicator_feeds`
|
||||
ADD COLUMN `msg_contentPlugins` tinyint(1) default NULL;");
|
||||
$database->query();
|
||||
}//if (!count($results))
|
||||
|
||||
$database->setQuery("SHOW FULL COLUMNS FROM #__ninjarsssyndicator_feeds where field = 'msg_includeCats'");
|
||||
$results = $database->loadObjectList();
|
||||
|
||||
if (!count($results))
|
||||
{
|
||||
$database->setQuery(" ALTER TABLE `#__ninjarsssyndicator_feeds`
|
||||
ADD COLUMN `msg_includeCats` tinyint(1) default NULL;");
|
||||
$database->query();
|
||||
}//if (!count($results))
|
||||
|
||||
?>
|
||||
<img src="<?php echo JURI::root(); ?>administrator/components/com_ninjarsssyndicator/assets/images/ninja-rss.jpg" alt="Ninja RSS Syndicator" title="Ninja RSS Syndicator" /><br />
|
||||
Ninja RSS Syndicator has been succesfully installed.
|
||||
|
||||
<p>Ninja RSS Syndicator was originally called BCA RSS Syndicator and developed by <a href="http://www.bodyhealthdebate.co.uk/" target="_blank">Body Health Debate</a> to promote Breast Cancer Awareness in the Joomla community.</p>
|
||||
|
||||
<?php }
|
||||
@@ -0,0 +1,41 @@
|
||||
CREATE TABLE IF NOT EXISTS `#__ninjarsssyndicator`
|
||||
(
|
||||
`id` tinyint(4) NOT NULL auto_increment,
|
||||
`msg` varchar(100) default NULL,
|
||||
`defaultType` varchar(4) default NULL,
|
||||
`count` varchar(4) default NULL,
|
||||
`orderby` varchar(10) default NULL,
|
||||
`numWords` tinyint(4) unsigned default NULL,
|
||||
`cache` smallint(9) default NULL,
|
||||
`imgUrl` varchar(100) default NULL,
|
||||
`renderAuthorFormat` varchar(10) default 'NAME',
|
||||
`renderHTML` tinyint(1) default '1',
|
||||
`FPItemsOnly` tinyint(1) default '0',
|
||||
`description` text default NULL, PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
INSERT IGNORE INTO `#__ninjarsssyndicator` (`id`, `msg`, `defaultType`, `count`, `orderby`, `numWords`, `cache`, `imgUrl`, `renderHTML`, `FPItemsOnly`) VALUES (1,'Get the latest news direct to your desktop','2.0','10','rdate',0,3600,'',1, 0);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__ninjarsssyndicator_feeds`
|
||||
(
|
||||
`id` tinyint(4) NOT NULL auto_increment,
|
||||
`feed_name` varchar(150) default NULL,
|
||||
`feed_description` text default NULL, `feed_type` varchar(10) default NULL,
|
||||
`feed_cache` smallint(9) default NULL,
|
||||
`feed_imgUrl` varchar(100) default NULL,
|
||||
`feed_button` varchar(100) default NULL,
|
||||
`feed_renderAuthorFormat` varchar(10) default '0',
|
||||
`feed_renderHTML` tinyint(1) default '0',
|
||||
`feed_renderImages` INT(1) NOT NULL,
|
||||
`msg_count` varchar(4) default NULL,
|
||||
`msg_orderby` varchar(10) default NULL,
|
||||
`msg_numWords` tinyint(4) unsigned default NULL,
|
||||
`msg_FPItemsOnly` tinyint(1) default '1',
|
||||
`msg_sectlist` varchar(50) default NULL,
|
||||
`msg_excatlist` varchar(100) default NULL,
|
||||
`msg_includeCats` tinyint(1) default NULL,
|
||||
`msg_fulltext` tinyint(1) default NULL,
|
||||
`msg_exitems` varchar(250) default NULL,
|
||||
`msg_contentPlugins` tinyint(1) default NULL,
|
||||
`published` tinyint(1) default NULL, PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// Security check to ensure this file is being included by a parent file.
|
||||
if (!defined('_JEXEC')) die('Direct Access to this location is not allowed.');
|
||||
?>
|
||||
Ninja RSS Syndicator has been succesfully uninstalled.
|
||||
<p><a href="http://ninjaforge.com/" target="_blank">NinjaForge</a></p>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
jimport( 'joomla.application.component.model' );
|
||||
|
||||
class NinjaRssSyndicatorModelButtonMaker extends JModel
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function save(){
|
||||
$url = urldecode(JRequest::getVar('imgurl', '', 'post', 'string'));
|
||||
$imgName = urldecode(JRequest::getVar('imgname', '', 'post', 'string'));
|
||||
$savePath = JPATH_ROOT . DS .'images'.DS.'stories';
|
||||
if(!$url || !$imgName){
|
||||
return 'Image invalid!';
|
||||
}
|
||||
if(!file_exists($savePath) || !is_readable($savePath) || !is_writable($savePath)){
|
||||
return 'Cannot access images/stories directory!';
|
||||
}
|
||||
//save image
|
||||
file_put_contents($savePath.DS.$imgName, file_get_contents($url));
|
||||
if(file_exists($savePath.DS.$imgName))
|
||||
return 'Image saved! link: <a href="'.JURI::root().'images/stories/'.$imgName.'" title="copy this url to use">'.JURI::root().'images/stories/'.$imgName.'</a>';
|
||||
else
|
||||
return "There's an error while save image.Please try again!";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
jimport( 'joomla.application.component.model' );
|
||||
|
||||
class ninjarsssyndicatorModelConfig extends JModel
|
||||
{
|
||||
|
||||
var $_data;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
global $mainframe, $option;
|
||||
}
|
||||
|
||||
function _buildQuery()
|
||||
{
|
||||
$query = ' SELECT * FROM #__ninjarsssyndicator '.
|
||||
' WHERE id = 1 '
|
||||
;
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function getData()
|
||||
{
|
||||
// Load the data
|
||||
if (empty( $this->_data )) {
|
||||
$query = $this->_buildQuery();
|
||||
$this->_db->setQuery( $query );
|
||||
$this->_data = $this->_db->loadObject();
|
||||
}
|
||||
if (!$this->_data) {
|
||||
$this->_data = '';
|
||||
}
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
function saveConfig(){
|
||||
$id = JRequest::getVar('id', '1', 'post', 'int');
|
||||
$msg = JRequest::getVar('msg', 'Get the latest news direct to your desktop', 'post', 'string');
|
||||
$msg = $this->_db->Quote($this->_db->getEscaped($msg), false);
|
||||
$defaultType = JRequest::getVar('defaultType', '1.0', 'post', 'string');
|
||||
$count = JRequest::getVar('count', '10', 'post', 'string');
|
||||
$orderby = JRequest::getVar('orderby', 'rdate', 'post', 'string');
|
||||
$numWords = JRequest::getVar('numWords', '25', 'post', 'int');
|
||||
|
||||
$cache = JRequest::getVar('cache', '3600', 'post', 'int');
|
||||
$imgUrl = JRequest::getVar('imgUrl', '', 'post', 'string');
|
||||
$imgUrl = $this->_db->Quote($this->_db->getEscaped($imgUrl), false);
|
||||
$renderAuthorFormat = JRequest::getVar('renderAuthorFormat', '1', 'post', 'string');
|
||||
$renderHTML = JRequest::getVar('renderHTML', '0', 'post', 'int');
|
||||
$FPItemsOnly = JRequest::getVar('FPItemsOnly', '1', 'post', 'int');
|
||||
$description = JRequest::getVar('description', '', 'post', 'string');
|
||||
$description = $this->_db->Quote($this->_db->getEscaped($description), false);
|
||||
|
||||
$query = "UPDATE #__ninjarsssyndicator SET msg = $msg,
|
||||
defaultType='$defaultType',
|
||||
count = '$count',
|
||||
orderby = '$orderby',
|
||||
numWords = $numWords,
|
||||
cache = $cache,
|
||||
imgUrl = $imgUrl,
|
||||
renderAuthorFormat = '$renderAuthorFormat',
|
||||
renderHTML = $renderHTML,
|
||||
FPItemsOnly = $FPItemsOnly,
|
||||
description = $description
|
||||
WHERE id = $id";
|
||||
|
||||
|
||||
$this->_db->setQuery($query);
|
||||
$this->_data = $this->_db->query();
|
||||
|
||||
if($this->_data)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
class NinjaRssSyndicatorViewAbout
|
||||
{
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$text = 'Dashboard';
|
||||
JToolBarHelper::title( JText::_( 'Dashboard').': <small><small>[ ' . $text.' ]</small></small>', 'systeminfo.png' );
|
||||
$this->about();
|
||||
}
|
||||
|
||||
function about()
|
||||
{
|
||||
?>
|
||||
<div class="m">
|
||||
<p class="sectionname" align="center"><img src="components/com_ninjarsssyndicator/assets/images/ninja-rss-syndicator.jpg"></p>
|
||||
<p align="left">
|
||||
The Ninja RSS Syndicator component makes your content available in different RSS, <a href="http://www.opml.org/" target="_blank">OPML</a> and <a href="http://www.atomenabled.org/" target="_blank">ATOM 0.3</a> formats.
|
||||
</p>
|
||||
<p align="left">If you need help with configuring this component just ask on the <a href="http://ninjaforge.com/" target="_blank">NinjaForge</a> forums.</p>
|
||||
<p align="left">Ninja RSS Syndicator was originally called the BCA RSS Syndicator and was developed by Body Health Debate to raise awareness of breast cancer in the Joomla Community.</p>
|
||||
<p align="left"><strong>License</strong></p>
|
||||
<p align="left">Ninja RSS Syndicator is free software; you can redistribute it and/or modify it under the terms of the <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">General Public License</a> as published by the Free Software Foundation. </p>
|
||||
<p align="left"><strong>Resources</strong></p>
|
||||
|
||||
<p align="left">Ninja RSS Syndicator is based upon the Joomla 1.0 DS-Syndicate component, and was converted to Joomla 1.5 by XiPat</p>
|
||||
<p align="left">Ninja RSS Syndicator makes use of the free <a href="http://www.bitfolge.de/rsscreator-en.html" target="_blank">FeedCreator class</a> by Kai Blankenhorn and the excellent XMLRPC Library from <a href="http://scripts.incutio.com/xmlrpc/" target="_blank">Incutio</a>. The Button Maker code was a creation of <a href="http://minimalverbosity.com/2003/May/19/buttons.htm" target="_blank">Bill Zeller</a> with an user interface from <a href="http://www.kalsey.com/tools/buttonmaker/" target="_blank">here</a>. The implementation of the MetaWeblog and blogger APIs were implemented by <a href="http://www.vd-tools.com" target="_blank">Gayle Davies</a> with help from code from NucleusCMS. My changes were to refactor the code.</p>
|
||||
|
||||
<p align="left">Copyright 2009, <a href="http://ninjaforge.com/" target="_blank">NinjaForge</a> and <a href="http://www.bodyhealthdebate.co.uk" target="_blank">Body Health Debate</a>.</p>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
+1
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright Bill Zeller, Minimal Verbosity.com
|
||||
*
|
||||
* Steal this code.
|
||||
*
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
$lettersPath = dirname(__FILE__).DS."letters.png";
|
||||
|
||||
$save_file = JRequest::getInt('save_img',0);
|
||||
$leftTextPosition = JRequest::getInt('leftTextPosition', 5);
|
||||
$rightTextPosition = JRequest::getInt('rightTextPosition', 29);
|
||||
$barPosition = JRequest::getInt('barPosition', 25);
|
||||
|
||||
$leftText = JRequest::getVar('leftText', 'RSS');
|
||||
$rightText = JRequest::getVar('rightText', 'VALID');
|
||||
$leftTextColor = JRequest::getVar('leftTextColor', 'ffffff');
|
||||
$rightTextColor = JRequest::getVar('rightTextColor', 'ffffff');
|
||||
$outerBorder = JRequest::getVar('outerBorder', '666666');
|
||||
$innerBorder = JRequest::getVar('innerBorder', 'ffffff');
|
||||
$leftFill = JRequest::getVar('leftFill', 'ff6600');
|
||||
$rightFill = JRequest::getVar('rightFill', '898E79');
|
||||
|
||||
$leftTextColor = str_replace('#', '', $leftTextColor);
|
||||
$rightTextColor = str_replace('#', '', $rightTextColor);
|
||||
$outerBorder = str_replace('#', '', $outerBorder);
|
||||
$innerBorder = str_replace('#', '', $innerBorder);
|
||||
$leftFill = str_replace('#', '', $leftFill);
|
||||
$rightFill = str_replace('#', '', $rightFill);
|
||||
|
||||
|
||||
function ImageColorAllocateHex( $image, $hex ) {
|
||||
for( $i=0; $i<3; $i++ ) {
|
||||
$temp = substr($hex, 2*$i, 2);
|
||||
$rgb[$i] = 16 * hexdec( substr($temp, 0, 1) ) + hexdec(substr($temp, 1, 1));
|
||||
}
|
||||
$rgb = ImageColorAllocate ( $image, $rgb[0], $rgb[1], $rgb[2] );
|
||||
return $rgb;
|
||||
}
|
||||
|
||||
function getRGB($hex ) {
|
||||
for( $i=0; $i<3; $i++ ) {
|
||||
$temp = substr($hex, 2*$i, 2);
|
||||
$rgb[$i] = 16 * hexdec( substr($temp, 0, 1) ) + hexdec(substr($temp, 1, 1));
|
||||
}
|
||||
return $rgb;
|
||||
}
|
||||
|
||||
$im = @imagecreatetruecolor(80, 15) or die ("Cannot Initialize new GD image stream");
|
||||
imagerectangle($im, 0, 0, 79, 14, ImageColorAllocateHex($im,$outerBorder));
|
||||
imagerectangle($im, 1, 1, 78, 13, ImageColorAllocateHex($im, $innerBorder));
|
||||
|
||||
$barPosition = $barPosition;
|
||||
imageline ($im, $barPosition, 1, $barPosition, 12, ImageColorAllocateHex($im, $innerBorder));
|
||||
|
||||
imagefilledrectangle($im, 2, 2, $barPosition-1, 12, ImageColorAllocateHex($im, $leftFill));
|
||||
imagefilledrectangle($im, $barPosition+1, 2, 77, 12, ImageColorAllocateHex($im, $rightFill));
|
||||
|
||||
$images[65] = array("x"=>0, "y"=>0, "w"=>6);
|
||||
$images[66] = array("x"=>6, "y"=>0, "w"=>6);
|
||||
$images[67] = array("x"=>12, "y"=>0, "w"=>6);
|
||||
$images[68] = array("x"=>18, "y"=>0, "w"=>6);
|
||||
$images[69] = array("x"=>24, "y"=>0, "w"=>5);
|
||||
$images[70] = array("x"=>29, "y"=>0, "w"=>5);
|
||||
$images[71] = array("x"=>34, "y"=>0, "w"=>6);
|
||||
$images[72] = array("x"=>40, "y"=>0, "w"=>6);
|
||||
$images[73] = array("x"=>46, "y"=>0, "w"=>3);
|
||||
$images[74] = array("x"=>49, "y"=>0, "w"=>6);
|
||||
$images[75] = array("x"=>55, "y"=>0, "w"=>6);
|
||||
$images[76] = array("x"=>61, "y"=>0, "w"=>5);
|
||||
$images[77] = array("x"=>66, "y"=>0, "w"=>7);
|
||||
$images[78] = array("x"=>73, "y"=>0, "w"=>7);
|
||||
$images[79] = array("x"=>80, "y"=>0, "w"=>6);
|
||||
$images[80] = array("x"=>86, "y"=>0, "w"=>6);
|
||||
$images[81] = array("x"=>92, "y"=>0, "w"=>6);
|
||||
$images[82] = array("x"=>98, "y"=>0, "w"=>6);
|
||||
$images[83] = array("x"=>104, "y"=>0, "w"=>6);
|
||||
$images[84] = array("x"=>110, "y"=>0, "w"=>5);
|
||||
$images[85] = array("x"=>115, "y"=>0, "w"=>6);
|
||||
$images[86] = array("x"=>121, "y"=>0, "w"=>7);
|
||||
$images[87] = array("x"=>128, "y"=>0, "w"=>7);
|
||||
$images[88] = array("x"=>135, "y"=>0, "w"=>7);
|
||||
$images[89] = array("x"=>142, "y"=>0, "w"=>7);
|
||||
$images[90] = array("x"=>149, "y"=>0, "w"=>5);
|
||||
$images[32] = array("x"=>154, "y"=>0, "w"=>4);
|
||||
|
||||
$images[49] = array("x"=>0, "y"=>10, "w"=>5);
|
||||
$images[50] = array("x"=>5, "y"=>10, "w"=>6);
|
||||
$images[51] = array("x"=>11, "y"=>10, "w"=>6);
|
||||
$images[52] = array("x"=>17, "y"=>10, "w"=>6);
|
||||
$images[53] = array("x"=>23, "y"=>10, "w"=>6);
|
||||
$images[54] = array("x"=>29, "y"=>10, "w"=>6);
|
||||
$images[55] = array("x"=>35, "y"=>10, "w"=>6);
|
||||
$images[56] = array("x"=>41, "y"=>10, "w"=>6);
|
||||
$images[57] = array("x"=>47, "y"=>10, "w"=>6);
|
||||
$images[48] = array("x"=>53, "y"=>10, "w"=>6);
|
||||
|
||||
$images[33] = array("x"=>59, "y"=>10, "w"=>3);// !
|
||||
$images[64] = array("x"=>62, "y"=>10, "w"=>7);// @
|
||||
$images[35] = array("x"=>69, "y"=>10, "w"=>7);// #
|
||||
$images[36] = array("x"=>76, "y"=>10, "w"=>6);// $
|
||||
$images[37] = array("x"=>82, "y"=>10, "w"=>7);// %
|
||||
$images[94] = array("x"=>89, "y"=>10, "w"=>5);// ^
|
||||
$images[38] = array("x"=>94, "y"=>10, "w"=>6);// &
|
||||
$images[42] = array("x"=>100, "y"=>10, "w"=>7);// *
|
||||
$images[40] = array("x"=>107, "y"=>10, "w"=>4);// (
|
||||
$images[41] = array("x"=>111, "y"=>10, "w"=>4);// )
|
||||
$images[95] = array("x"=>115, "y"=>10, "w"=>6);// _
|
||||
$images[43] = array("x"=>121, "y"=>10, "w"=>7);// +
|
||||
$images[96] = array("x"=>128, "y"=>10, "w"=>4);// `
|
||||
$images[126] = array("x"=>132, "y"=>10, "w"=>6);// ~
|
||||
$images[91] = array("x"=>138, "y"=>10, "w"=>4);// [
|
||||
$images[93] = array("x"=>142, "y"=>10, "w"=>4);// ]
|
||||
$images[92] = array("x"=>146, "y"=>10, "w"=>5);// \
|
||||
$images[123] = array("x"=>151, "y"=>10, "w"=>5);// {
|
||||
$images[125] = array("x"=>156, "y"=>10, "w"=>5);// }
|
||||
$images[124] = array("x"=>161, "y"=>10, "w"=>3);// |
|
||||
$images[59] = array("x"=>164, "y"=>10, "w"=>4);// ;
|
||||
$images[58] = array("x"=>168, "y"=>10, "w"=>3);// :
|
||||
$images[39] = array("x"=>171, "y"=>10, "w"=>3);// '
|
||||
$images[34] = array("x"=>174, "y"=>10, "w"=>5);// "
|
||||
$images[44] = array("x"=>179, "y"=>10, "w"=>4);// ,
|
||||
$images[46] = array("x"=>183, "y"=>10, "w"=>3);// .
|
||||
$images[47] = array("x"=>186, "y"=>10, "w"=>5);// /
|
||||
$images[60] = array("x"=>191, "y"=>10, "w"=>5);// <
|
||||
$images[62] = array("x"=>196, "y"=>10, "w"=>5);// >
|
||||
$images[63] = array("x"=>201, "y"=>10, "w"=>6);// ?
|
||||
$images[61] = array("x"=>207, "y"=>10, "w"=>5);// =
|
||||
|
||||
|
||||
$letters = imagecreatefrompng($lettersPath);
|
||||
$rgb = getRGB($leftTextColor);
|
||||
|
||||
$index = imagecolorexact($letters, 0, 0, 0);
|
||||
imagecolorset ($letters, $index, $rgb[0], $rgb[1], $rgb[2]);
|
||||
|
||||
$leftText = stripslashes(strtoupper($leftText));
|
||||
|
||||
$leftPos = $leftTextPosition;
|
||||
for($i=0;$i<strlen($leftText);$i++){
|
||||
|
||||
$c = ord($leftText[$i]);
|
||||
imagecopy ($im, $letters, $leftPos, 5, $images[$c]["x"], $images[$c]["y"], $images[$c]["w"], 6);
|
||||
$leftPos+=$images[$c]["w"];
|
||||
}
|
||||
|
||||
$letters = imagecreatefrompng($lettersPath);
|
||||
$rgb = getRGB($rightTextColor);
|
||||
|
||||
$index = imagecolorexact($letters, 0, 0, 0);
|
||||
imagecolorset ($letters, $index, $rgb[0], $rgb[1], $rgb[2]);
|
||||
|
||||
$rightText = stripslashes(strtoupper($rightText));
|
||||
|
||||
$rightPos = $rightTextPosition;
|
||||
for($i=0;$i<strlen($rightText);$i++){
|
||||
|
||||
$c = ord($rightText[$i]);
|
||||
imagecopy ($im, $letters, $rightPos, 5, $images[$c]["x"], $images[$c]["y"], $images[$c]["w"], 6);
|
||||
$rightPos+=$images[$c]["w"];
|
||||
}
|
||||
if($save_file)
|
||||
{
|
||||
$save_path =JPATH_ROOT .DS. "components".DS."com_ninjarsssyndicator".DS."assets".DS."images".DS."buttons";
|
||||
|
||||
if(!_isWritable($save_path.'/'))
|
||||
{
|
||||
exit("Cannot access $save_path directory!");
|
||||
}
|
||||
$img_name = $leftText .'-'. $rightText. '-'. time() . '.png';
|
||||
$img_name = strtolower($img_name);
|
||||
imagepng($im, $save_path .DS. $img_name);
|
||||
|
||||
if(file_exists($save_path .DS. $img_name))
|
||||
{
|
||||
exit('Image saved! link: <a href="'.JURI::root().'components/com_ninjarsssyndicator/assets/images/buttons/'.$img_name.'" title="'.$img_name.'">'.JURI::root().'components/com_ninjarsssyndicator/assets/images/buttons/'.$img_name.'</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
exit("Error saving image");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
header ("Content-type: image/png");
|
||||
imagepng ($im);
|
||||
exit();
|
||||
}
|
||||
|
||||
function _isWritable($path) {
|
||||
if ($path{strlen($path)-1}=='/')
|
||||
return _isWritable($path.uniqid(mt_rand()).'.tmp');
|
||||
|
||||
if (file_exists($path)) {
|
||||
if (!($f = @fopen($path, 'r+')))
|
||||
return false;
|
||||
fclose($f);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!($f = @fopen($path, 'w')))
|
||||
return false;
|
||||
fclose($f);
|
||||
unlink($path);
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
<?php defined('_JEXEC') or die('Restricted access'); ?>
|
||||
<form method="post" action="index.php" name="adminForm" id="adminForm">
|
||||
<table align="left">
|
||||
<tr>
|
||||
<td ><strong>Preview image:</strong></td>
|
||||
|
||||
<td ><p id="gen"><img src="<?php echo JURI::root() ?>administrator/index.php?option=com_ninjarsssyndicator&task=genbtn&outerBorder=#666666&innerBorder=#ffffff&barPosition=25&leftFill=#ff6600&leftText=RSS&leftTextColor=#ffffff&leftTextPosition=5&rightFill=#898E79&rightText=Valid&rightTextColor=#ffffff&rightTextPosition=29" alt="" id="generated" height="15" width="80"></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><strong>Borders</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="outerBorder">Outer border</label></td>
|
||||
<td><input name="outerBorder" id="outerBorder" value="#666666" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['outerBorder'])" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="innerBorder">Inner border</label></td>
|
||||
<td><input name="innerBorder" id="innerBorder" value="#ffffff" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['innerBorder']);" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="barPosition">Bar Position</label></td>
|
||||
<td><input name="barPosition" id="barPosition" value="25" size="20" type="text">
|
||||
pixels from the left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><strong>Left Box</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="leftText">Text</label></td>
|
||||
<td><input name="leftText" id="leftText" value="RSS" size="20" type="text"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="leftFill">Background</label></td>
|
||||
<td><input name="leftFill" id="leftFill" value="#ff6600" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['leftFill']);" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="leftTextColor">Text color</label></td>
|
||||
<td><input name="leftTextColor" id="leftTextColor" value="#ffffff" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['leftTextColor']);" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="leftTextPosition">Text start</label></td>
|
||||
<td><input name="leftTextPosition" id="leftTextPosition" value="5" size="20" type="text">
|
||||
pixels from the left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><strong>Right Box</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rightText">Text</label></td>
|
||||
<td><input name="rightText" id="rightText" value="Valid" size="20" type="text"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rightFill">Background</label></td>
|
||||
<td><input name="rightFill" id="rightFill" value="#898E79" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['rightFill']);" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rightTextColor">Text color</label></td>
|
||||
<td><input name="rightTextColor" id="rightTextColor" value="#ffffff" size="20" type="text">
|
||||
<a href="javascript:TCP.popup(document.forms['adminForm'].elements['rightTextColor']);" ><img src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/images/sel.gif" alt="Color Picker" title="Pick a color" border="0" height="13" width="15"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rightTextPosition">Text start</label></td>
|
||||
<td><input name="rightTextPosition" id="rightTextPosition" value="29" size="20" type="text">
|
||||
pixels from the bar</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><p>
|
||||
<input name="Reset-Render" value="Reset" type="button" onclick="renderImage('reset')" />
|
||||
<input name="Render" value="Render" type="button" onclick="renderImage('render');" />
|
||||
<input name="Save" value="Save" type="button" id="btnSave" onclick="renderImage('save');" />
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr><td colspan="2">
|
||||
</td></tr>
|
||||
</table>
|
||||
<div id="btnsavetip" style="clear:both; display:none"></div>
|
||||
<input type="hidden" name="option" value="com_ninjarsssyndicator" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="save_img" value="0" />
|
||||
<input type="hidden" name="controller" id="controller" value="buttonmaker" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function toggleTip(msg)
|
||||
{
|
||||
if(!msg)
|
||||
$('btnsavetip').setStyle('display','none');
|
||||
else
|
||||
{
|
||||
$('btnsavetip').setHTML(msg);
|
||||
$('btnsavetip').setStyle('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
function renderImage(action) {
|
||||
var url = "<?php echo JURI::root();?>";
|
||||
var frm = $("adminForm");
|
||||
var imgUrl = url+"administrator/components/com_ninjarsssyndicator/views/buttonmaker/tmpl/button.php";
|
||||
if (action=="reset") {
|
||||
$("outerBorder").value="#666666";
|
||||
$("innerBorder").value="#ffffff";
|
||||
$("barPosition").value="25";
|
||||
$("leftText").value="RSS";
|
||||
$("leftFill").value="#ff6600";
|
||||
$("leftTextColor").value="#ffffff";
|
||||
$("leftTextPosition").value="5";
|
||||
$("rightText").value="Valid";
|
||||
$("rightFill").value="#898E79";
|
||||
$("rightTextColor").value="#ffffff";
|
||||
$("rightTextPosition").value="30";
|
||||
|
||||
$("generated").src=imgUrl;
|
||||
}
|
||||
else if(action=="save")
|
||||
{
|
||||
imgUrl = renderImage('');
|
||||
frm.getElement('input[name=task]').value = 'genbtn';
|
||||
frm.getElement('input[name=controller]').value = '';
|
||||
frm.getElement('input[name=save_img]').value = '1';
|
||||
frm.send({
|
||||
method: 'POST',
|
||||
onRequest: function() {
|
||||
toggleTip('');
|
||||
$('btnSave').setAttribute('disabled', 'disabled');
|
||||
},
|
||||
onComplete: function() {
|
||||
$('btnSave').removeAttribute('disabled');
|
||||
toggleTip(this.response.text);
|
||||
frm.getElement('input[name=save_img]').value = '0';
|
||||
},
|
||||
onFailure:function() {
|
||||
$('btnSave').removeAttribute('disabled');
|
||||
frm.getElement('input[name=save_img]').value = '0';
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
else if(action == "render")
|
||||
{
|
||||
toggleTip('Right click on the<strong> preview image</strong> and select <strong>Save as...</strong> to save the image');
|
||||
}
|
||||
|
||||
//build image url
|
||||
var inputElems = frm.getElementsByTagName("input");
|
||||
var qs = "";
|
||||
for (var i = 0 ; i < inputElems.length; i++)
|
||||
{
|
||||
if (inputElems[i].getAttribute("type")=="text") {
|
||||
var currElem = inputElems[i];
|
||||
qs+=currElem.getAttribute("id");
|
||||
qs+="=";
|
||||
qs+=currElem.value;
|
||||
if (i!=inputElems.length-1)
|
||||
qs+="&";
|
||||
}
|
||||
}
|
||||
//replace # chars as http don't like 'em
|
||||
var re = new RegExp ('#', 'gi') ;
|
||||
qs = qs.replace(re, '') ;
|
||||
imgUrl = url+"administrator/index.php?option=com_ninjarsssyndicator&task=genbtn&"+qs
|
||||
$("generated").src= imgUrl;
|
||||
return imgUrl;
|
||||
}
|
||||
var mosUrl = "<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/";
|
||||
</script>
|
||||
<script language="JavaScript" src="<?php echo JURI::root() ?>administrator/components/com_ninjarsssyndicator/assets/js/picker.js"></script>
|
||||
+1
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class NinjaRssSyndicatorViewButtonMaker extends JView
|
||||
{
|
||||
function display($tpl = null)
|
||||
{
|
||||
$text = 'Button maker';
|
||||
JToolBarHelper::title( JText::_( 'Ninja RSS Syndicator').': <small><small>[ ' . $text.' ]</small></small>', 'mediamanager.png' );
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user