Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
birdkiwi committed Jul 26, 2016
0 parents commit cb42214
Show file tree
Hide file tree
Showing 81 changed files with 4,119 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),

// Clean the build folder
clean: {
build: {
src: ['build/**', 'build-zip']
}
},
// Copy to build folder
copy: {
readme: {
src: ['README.md'],
dest: 'build/'
},
component: {
expand: true,
cwd: 'component/',
src: ['**'],
dest: 'build/'
}
},
// Compress the build folder into an upload-ready zip file
compress: {
component: {
options: {
archive: 'build-zip/<%= pkg.name %>-<%= pkg.version %>.zip'
},
files: [
{expand: true, cwd: 'build/', src: ['**']}
]
}
}
});

// Load all grunt plugins here
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');

// Build task
grunt.registerTask( 'build', [
'clean:build',
'copy:readme',
'copy:component',
'compress:component'
]);

};
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Simple Callback Component#
Компонент административной части для модуля [Simple Callback Module](https://github.com/birdkiwi/mod_simplecallback/)
Joomla 3.0+

Скачать компонент: [Все версии](https://github.com/birdkiwi/com_simplecallback/releases/)

**Возможности:**

Компонент позволяет просматривать все сохраненные сообщения из модуля Simple Callback Module.

![mod_simplecallback screenshot](http://joomla.startler.ru/images/screenshots/com_simplecallback.png)
13 changes: 13 additions & 0 deletions component/administrator/access.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<access component="com_simplecallback">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
</section>

</access>
1 change: 1 addition & 0 deletions component/administrator/assets/css/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
18 changes: 18 additions & 0 deletions component/administrator/assets/css/simplecallback.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.icon-48-messages {
background-image: url(../images/l_messages.png);
padding-left:60px!important;
}

.icon-48-message {
background-image: url(../images/l_messages.png);
padding-left:60px!important;
}

.color-box-messages {
float: left; width: 15px; height: 15px; margin-right: 5px; border: 1px solid rgba(0, 0, 0, .2);}



.other-filters{
padding: 0 14px;
}
1 change: 1 addition & 0 deletions component/administrator/assets/images/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added component/administrator/assets/images/s_messages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions component/administrator/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
93 changes: 93 additions & 0 deletions component/administrator/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset label="COM_SIMPLECALLBACK" name="simplecallback">

</fieldset>

<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC" label="JCONFIG_PERMISSIONS_LABEL">
<field name="rules" type="rules" component="com_simplecallback" class="inputbox" filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL" section="component" />
</fieldset>

<fieldset name="component">
<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">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field name="history_limit" type="text" filter="integer" label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL" description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC" default="5"/>
</fieldset>
</config>
<!--
########################################################################################
The following are a list of all the different types of fields you can add to this file
They are here for copy pasting - neat eh?
########################################################################################
http://docs.joomla.org/Calendar_parameter_type
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
http://docs.joomla.org/Category_parameter_type
<field name="mycategory" type="category" label="Select a category" description="" section="3" />
http://docs.joomla.org/Editors_parameter_type
<field name="myeditor" type="editors" default="none" label="Select an editor" />
http://docs.joomla.org/Filelist_parameter_type
<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />
http://docs.joomla.org/Folderlist_parameter_type
<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />
http://docs.joomla.org/Helpsites_parameter_type
<field name="myhelpsite" type="helpsites" default="" label="Select a help site" description="" />
http://docs.joomla.org/Hidden_parameter_type
<field name="mysecretvariable" type="hidden" default="" />
http://docs.joomla.org/Imagelist_parameter_type
<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />
http://docs.joomla.org/Languages_parameter_type
<field name="mylanguage" type="languages" client="site" default="en-GB" label="Select a language" description="" />
http://docs.joomla.org/List_parameter_type
<field name="mylistvalue" type="list" default="" label="Select an option" description="">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
</field>
http://docs.joomla.org/Menu_parameter_type
<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />
http://docs.joomla.org/Menuitem_parameter_type
<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />
http://docs.joomla.org/Password_parameter_type
<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />
http://docs.joomla.org/Radio_parameter_type
<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
<option value="0">1</option>
<option value="1">2</option>
</field>
http://docs.joomla.org/Spacer_parameter_type
<field type="spacer" default="&lt;b&gt;Advanced parameters&lt;/b&gt;" />
http://docs.joomla.org/Sql_parameter_type
<field name="myfield" type="sql" default="10" label="Select an article" query="SELECT id, title FROM #__content" key_field=”id” value_field=”title” />
http://docs.joomla.org/Text_parameter_type
<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />
http://docs.joomla.org/Textarea_parameter_type
<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />
http://docs.joomla.org/Timezones_parameter_type
<field name="mytimezone" type="timezones" default="-10" label="Select a timezone" description="" />
http://docs.joomla.org/Usergroup_parameter_type
<field name="myusergroups" type="usergroup" default="" label="Select a user group" description="" />
-->
39 changes: 39 additions & 0 deletions component/administrator/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/**
* @version CVS: 1.0.0
* @package Com_Simplecallback
* @author Alexey Startler <[email protected]>
* @copyright 2016 Alexey Startler
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;

/**
* Class SimplecallbackController
*
* @since 1.6
*/
class SimplecallbackController extends JControllerLegacy
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param mixed $urlparams 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)
{
$view = JFactory::getApplication()->input->getCmd('view', 'messages');
JFactory::getApplication()->input->set('view', $view);

parent::display($cachable, $urlparams);

return $this;
}
}
1 change: 1 addition & 0 deletions component/administrator/controllers/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
32 changes: 32 additions & 0 deletions component/administrator/controllers/message.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* @version CVS: 1.0.0
* @package Com_Simplecallback
* @author Alexey Startler <[email protected]>
* @copyright 2016 Alexey Startler
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controllerform');

/**
* Message controller class.
*
* @since 1.6
*/
class SimplecallbackControllerMessage extends JControllerForm
{
/**
* Constructor
*
* @throws Exception
*/
public function __construct()
{
$this->view_list = 'messages';
parent::__construct();
}
}
107 changes: 107 additions & 0 deletions component/administrator/controllers/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php
/**
* @version CVS: 1.0.0
* @package Com_Simplecallback
* @author Alexey Startler <[email protected]>
* @copyright 2016 Alexey Startler
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access.
defined('_JEXEC') or die;

jimport('joomla.application.component.controlleradmin');

use Joomla\Utilities\ArrayHelper;

/**
* Messages list controller class.
*
* @since 1.6
*/
class SimplecallbackControllerMessages extends JControllerAdmin
{
/**
* Method to clone existing Messages
*
* @return void
*/
public function duplicate()
{
// Check for request forgeries
Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

// Get id(s)
$pks = $this->input->post->get('cid', array(), 'array');

try
{
if (empty($pks))
{
throw new Exception(JText::_('COM_SIMPLECALLBACK_NO_ELEMENT_SELECTED'));
}

ArrayHelper::toInteger($pks);
$model = $this->getModel();
$model->duplicate($pks);
$this->setMessage(Jtext::_('COM_SIMPLECALLBACK_ITEMS_SUCCESS_DUPLICATED'));
}
catch (Exception $e)
{
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
}

$this->setRedirect('index.php?option=com_simplecallback&view=messages');
}

/**
* Proxy for getModel.
*
* @param string $name Optional. Model name
* @param string $prefix Optional. Class prefix
* @param array $config Optional. Configuration array for model
*
* @return object The Model
*
* @since 1.6
*/
public function getModel($name = 'message', $prefix = 'SimplecallbackModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));

return $model;
}

/**
* Method to save the submitted ordering values for records via AJAX.
*
* @return void
*
* @since 3.0
*/
public function saveOrderAjax()
{
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
$order = $input->post->get('order', array(), 'array');

// Sanitize the input
ArrayHelper::toInteger($pks);
ArrayHelper::toInteger($order);

// Get the model
$model = $this->getModel();

// Save the ordering
$return = $model->saveorder($pks, $order);

if ($return)
{
echo "1";
}

// Close the application
JFactory::getApplication()->close();
}
}
1 change: 1 addition & 0 deletions component/administrator/helpers/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
Loading

0 comments on commit cb42214

Please sign in to comment.