Skip to content

Commit cb42214

Browse files
committed
Initial commit
0 parents  commit cb42214

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+4119
-0
lines changed

Gruntfile.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON( 'package.json' ),
6+
7+
// Clean the build folder
8+
clean: {
9+
build: {
10+
src: ['build/**', 'build-zip']
11+
}
12+
},
13+
// Copy to build folder
14+
copy: {
15+
readme: {
16+
src: ['README.md'],
17+
dest: 'build/'
18+
},
19+
component: {
20+
expand: true,
21+
cwd: 'component/',
22+
src: ['**'],
23+
dest: 'build/'
24+
}
25+
},
26+
// Compress the build folder into an upload-ready zip file
27+
compress: {
28+
component: {
29+
options: {
30+
archive: 'build-zip/<%= pkg.name %>-<%= pkg.version %>.zip'
31+
},
32+
files: [
33+
{expand: true, cwd: 'build/', src: ['**']}
34+
]
35+
}
36+
}
37+
});
38+
39+
// Load all grunt plugins here
40+
grunt.loadNpmTasks('grunt-contrib-copy');
41+
grunt.loadNpmTasks('grunt-contrib-clean');
42+
grunt.loadNpmTasks('grunt-contrib-compress');
43+
44+
// Build task
45+
grunt.registerTask( 'build', [
46+
'clean:build',
47+
'copy:readme',
48+
'copy:component',
49+
'compress:component'
50+
]);
51+
52+
};

LICENSE

+339
Large diffs are not rendered by default.

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#Simple Callback Component#
2+
Компонент административной части для модуля [Simple Callback Module](https://github.com/birdkiwi/mod_simplecallback/)
3+
Joomla 3.0+
4+
5+
Скачать компонент: [Все версии](https://github.com/birdkiwi/com_simplecallback/releases/)
6+
7+
**Возможности:**
8+
9+
Компонент позволяет просматривать все сохраненные сообщения из модуля Simple Callback Module.
10+
11+
![mod_simplecallback screenshot](http://joomla.startler.ru/images/screenshots/com_simplecallback.png)

component/administrator/access.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<access component="com_simplecallback">
3+
<section name="component">
4+
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
5+
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
6+
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
7+
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
8+
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
9+
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
10+
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
11+
</section>
12+
13+
</access>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.icon-48-messages {
2+
background-image: url(../images/l_messages.png);
3+
padding-left:60px!important;
4+
}
5+
6+
.icon-48-message {
7+
background-image: url(../images/l_messages.png);
8+
padding-left:60px!important;
9+
}
10+
11+
.color-box-messages {
12+
float: left; width: 15px; height: 15px; margin-right: 5px; border: 1px solid rgba(0, 0, 0, .2);}
13+
14+
15+
16+
.other-filters{
17+
padding: 0 14px;
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>

component/administrator/config.xml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<config>
3+
<fieldset label="COM_SIMPLECALLBACK" name="simplecallback">
4+
5+
</fieldset>
6+
7+
<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC" label="JCONFIG_PERMISSIONS_LABEL">
8+
<field name="rules" type="rules" component="com_simplecallback" class="inputbox" filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL" section="component" />
9+
</fieldset>
10+
11+
<fieldset name="component">
12+
<field name="save_history" type="radio" class="btn-group btn-group-yesno" default="0" label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL" description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC">
13+
<option value="0">JNO</option>
14+
<option value="1">JYES</option>
15+
</field>
16+
17+
<field name="history_limit" type="text" filter="integer" label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL" description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC" default="5"/>
18+
</fieldset>
19+
</config>
20+
<!--
21+
########################################################################################
22+
The following are a list of all the different types of fields you can add to this file
23+
They are here for copy pasting - neat eh?
24+
########################################################################################
25+
26+
http://docs.joomla.org/Calendar_parameter_type
27+
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
28+
29+
http://docs.joomla.org/Category_parameter_type
30+
<field name="mycategory" type="category" label="Select a category" description="" section="3" />
31+
32+
http://docs.joomla.org/Editors_parameter_type
33+
<field name="myeditor" type="editors" default="none" label="Select an editor" />
34+
35+
http://docs.joomla.org/Filelist_parameter_type
36+
<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />
37+
38+
http://docs.joomla.org/Folderlist_parameter_type
39+
<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />
40+
41+
http://docs.joomla.org/Helpsites_parameter_type
42+
<field name="myhelpsite" type="helpsites" default="" label="Select a help site" description="" />
43+
44+
http://docs.joomla.org/Hidden_parameter_type
45+
<field name="mysecretvariable" type="hidden" default="" />
46+
47+
http://docs.joomla.org/Imagelist_parameter_type
48+
<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />
49+
50+
http://docs.joomla.org/Languages_parameter_type
51+
<field name="mylanguage" type="languages" client="site" default="en-GB" label="Select a language" description="" />
52+
53+
http://docs.joomla.org/List_parameter_type
54+
<field name="mylistvalue" type="list" default="" label="Select an option" description="">
55+
<option value="0">Option 1</option>
56+
<option value="1">Option 2</option>
57+
</field>
58+
59+
http://docs.joomla.org/Menu_parameter_type
60+
<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />
61+
62+
http://docs.joomla.org/Menuitem_parameter_type
63+
<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />
64+
65+
http://docs.joomla.org/Password_parameter_type
66+
<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />
67+
68+
http://docs.joomla.org/Radio_parameter_type
69+
<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
70+
<option value="0">1</option>
71+
<option value="1">2</option>
72+
</field>
73+
74+
http://docs.joomla.org/Spacer_parameter_type
75+
<field type="spacer" default="&lt;b&gt;Advanced parameters&lt;/b&gt;" />
76+
77+
http://docs.joomla.org/Sql_parameter_type
78+
<field name="myfield" type="sql" default="10" label="Select an article" query="SELECT id, title FROM #__content" key_field=”id” value_field=”title” />
79+
80+
http://docs.joomla.org/Text_parameter_type
81+
<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />
82+
83+
http://docs.joomla.org/Textarea_parameter_type
84+
<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />
85+
86+
http://docs.joomla.org/Timezones_parameter_type
87+
<field name="mytimezone" type="timezones" default="-10" label="Select a timezone" description="" />
88+
89+
http://docs.joomla.org/Usergroup_parameter_type
90+
<field name="myusergroups" type="usergroup" default="" label="Select a user group" description="" />
91+
92+
93+
-->
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* @version CVS: 1.0.0
5+
* @package Com_Simplecallback
6+
* @author Alexey Startler <[email protected]>
7+
* @copyright 2016 Alexey Startler
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*/
10+
// No direct access
11+
defined('_JEXEC') or die;
12+
13+
/**
14+
* Class SimplecallbackController
15+
*
16+
* @since 1.6
17+
*/
18+
class SimplecallbackController extends JControllerLegacy
19+
{
20+
/**
21+
* Method to display a view.
22+
*
23+
* @param boolean $cachable If true, the view output will be cached
24+
* @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
25+
*
26+
* @return JController This object to support chaining.
27+
*
28+
* @since 1.5
29+
*/
30+
public function display($cachable = false, $urlparams = false)
31+
{
32+
$view = JFactory::getApplication()->input->getCmd('view', 'messages');
33+
JFactory::getApplication()->input->set('view', $view);
34+
35+
parent::display($cachable, $urlparams);
36+
37+
return $this;
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* @version CVS: 1.0.0
4+
* @package Com_Simplecallback
5+
* @author Alexey Startler <[email protected]>
6+
* @copyright 2016 Alexey Startler
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
10+
// No direct access
11+
defined('_JEXEC') or die;
12+
13+
jimport('joomla.application.component.controllerform');
14+
15+
/**
16+
* Message controller class.
17+
*
18+
* @since 1.6
19+
*/
20+
class SimplecallbackControllerMessage extends JControllerForm
21+
{
22+
/**
23+
* Constructor
24+
*
25+
* @throws Exception
26+
*/
27+
public function __construct()
28+
{
29+
$this->view_list = 'messages';
30+
parent::__construct();
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?php
2+
/**
3+
* @version CVS: 1.0.0
4+
* @package Com_Simplecallback
5+
* @author Alexey Startler <[email protected]>
6+
* @copyright 2016 Alexey Startler
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
10+
// No direct access.
11+
defined('_JEXEC') or die;
12+
13+
jimport('joomla.application.component.controlleradmin');
14+
15+
use Joomla\Utilities\ArrayHelper;
16+
17+
/**
18+
* Messages list controller class.
19+
*
20+
* @since 1.6
21+
*/
22+
class SimplecallbackControllerMessages extends JControllerAdmin
23+
{
24+
/**
25+
* Method to clone existing Messages
26+
*
27+
* @return void
28+
*/
29+
public function duplicate()
30+
{
31+
// Check for request forgeries
32+
Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
33+
34+
// Get id(s)
35+
$pks = $this->input->post->get('cid', array(), 'array');
36+
37+
try
38+
{
39+
if (empty($pks))
40+
{
41+
throw new Exception(JText::_('COM_SIMPLECALLBACK_NO_ELEMENT_SELECTED'));
42+
}
43+
44+
ArrayHelper::toInteger($pks);
45+
$model = $this->getModel();
46+
$model->duplicate($pks);
47+
$this->setMessage(Jtext::_('COM_SIMPLECALLBACK_ITEMS_SUCCESS_DUPLICATED'));
48+
}
49+
catch (Exception $e)
50+
{
51+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
52+
}
53+
54+
$this->setRedirect('index.php?option=com_simplecallback&view=messages');
55+
}
56+
57+
/**
58+
* Proxy for getModel.
59+
*
60+
* @param string $name Optional. Model name
61+
* @param string $prefix Optional. Class prefix
62+
* @param array $config Optional. Configuration array for model
63+
*
64+
* @return object The Model
65+
*
66+
* @since 1.6
67+
*/
68+
public function getModel($name = 'message', $prefix = 'SimplecallbackModel', $config = array())
69+
{
70+
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
71+
72+
return $model;
73+
}
74+
75+
/**
76+
* Method to save the submitted ordering values for records via AJAX.
77+
*
78+
* @return void
79+
*
80+
* @since 3.0
81+
*/
82+
public function saveOrderAjax()
83+
{
84+
// Get the input
85+
$input = JFactory::getApplication()->input;
86+
$pks = $input->post->get('cid', array(), 'array');
87+
$order = $input->post->get('order', array(), 'array');
88+
89+
// Sanitize the input
90+
ArrayHelper::toInteger($pks);
91+
ArrayHelper::toInteger($order);
92+
93+
// Get the model
94+
$model = $this->getModel();
95+
96+
// Save the ordering
97+
$return = $model->saveorder($pks, $order);
98+
99+
if ($return)
100+
{
101+
echo "1";
102+
}
103+
104+
// Close the application
105+
JFactory::getApplication()->close();
106+
}
107+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>

0 commit comments

Comments
 (0)