Skip to content

Commit

Permalink
Update vote module
Browse files Browse the repository at this point in the history
  • Loading branch information
voltan committed Feb 19, 2014
1 parent fe819f8 commit 5ee3223
Show file tree
Hide file tree
Showing 28 changed files with 576 additions and 433 deletions.
3 changes: 3 additions & 0 deletions asset/image/.directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Dolphin]
Timestamp=2014,2,19,15,6,57
Version=3
3 changes: 0 additions & 3 deletions asset/script/front.css

This file was deleted.

40 changes: 20 additions & 20 deletions asset/script/plus.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
function Set_Vote(data, file, item, module) {
$.ajax({
type:"POST",
url:file,
data:data,
dataType: "json",
success:function (result) {
$('#vote-' + module + '-' + item + '-up').attr('class', 'btn btn-small disabled').attr('onclick', '');
$('#vote-' + module + '-' + item + '-down').attr('class', 'btn btn-small disabled').attr('onclick', '');
if (result.status == 1) {
if (result.point > 0) {
$('#vote-' + module + '-' + item + '-do').attr('class', 'btn btn-small btn-success').html(result.point);
function Set_Vote(data, file, item, table, module) {
$.ajax({
type:"POST",
url:file,
data:data,
dataType: "json",
success:function (result) {
$('#vote-' + module + '-' + table + '-' + item + '-up').attr('class', 'btn btn-default btn-sm disabled').attr('onclick', '');
$('#vote-' + module + '-' + table + '-' + item + '-down').attr('class', 'btn btn-default btn-sm disabled').attr('onclick', '');
if (result.status == 1) {
if (result.point > 0) {
$('#vote-' + module + '-' + table + '-' + item + '-do').attr('class', 'btn btn-success btn-sm disabled').html(result.point_view);
} else {
$('#vote-' + module + '-' + table + '-' + item + '-do').attr('class', 'btn btn-danger btn-sm disabled').html(result.point_view);
}
} else {
$('#vote-' + module + '-' + item + '-do').attr('class', 'btn btn-small btn-danger').html(result.point);
}
} else {
$('#vote-' + module + '-' + item + '-do').attr('data-toggle', 'popover').attr('data-placement', 'top').attr('data-content', result.message).popover('show');
setTimeout(function() {$('#vote-' + module + '-' + item + '-do').popover('hide')}, 3000);
}
}
});
$('#vote-' + module + '-' + table + '-' + item + '-do').popover({trigger: 'hover', placement: 'top', toggle : 'popover', content : result.message, title: result.title, container: 'body'}).popover('show').attr('class', 'btn btn-default btn-sm disabled');
setTimeout(function() {$('#vote-' + module + '-' + table + '-' + item + '-do').popover('hide')}, 3000);
}
}
});
}
22 changes: 0 additions & 22 deletions config/acl.php

This file was deleted.

27 changes: 10 additions & 17 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
<?php
/**
* Vote module config
* Pi Engine (http://pialog.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Copyright (c) Pi Engine http://www.xoopsengine.org
* @license http://www.xoopsengine.org/license New BSD License
* @author Hossein Azizabadi <[email protected]>
* @since 3.0
* @package Module\Vote
* @version $Id$
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
'category' => array(
array(
'title' => __('Admin'),
'name' => 'admin'
),
),
array(
'title' => __('Vote'),
'name' => 'vote'
Expand All @@ -45,8 +38,8 @@
'edit' => 'text',
'filter' => 'number_int',
'value' => 500
),
// vote
),
// vote
'vote_delay' => array(
'category' => 'vote',
'title' => __('Delay time'),
Expand Down
28 changes: 7 additions & 21 deletions config/database.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
<?php
/**
* Vote module config
* Pi Engine (http://pialog.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Copyright (c) Pi Engine http://www.xoopsengine.org
* @license http://www.xoopsengine.org/license New BSD License
* @author Hossein Azizabadi <[email protected]>
* @since 3.0
* @package Module\Vote
* @version $Id$
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// SQL schema/data file
'sqlfile' => 'sql/mysql.sql',
// Tables to be removed during uninstall, optional - the table list will be generated automatically upon installation
// will be fix
'schema' => array(
'point' => 'table',
'case' => 'table',
)
);
83 changes: 26 additions & 57 deletions config/module.php
Original file line number Diff line number Diff line change
@@ -1,71 +1,40 @@
<?php
/**
* Vote module config
* Pi Engine (http://pialog.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Copyright (c) Pi Engine http://www.xoopsengine.org
* @license http://www.xoopsengine.org/license New BSD License
* @author Hossein Azizabadi <[email protected]>
* @since 3.0
* @package Module\Vote
* @version $Id$
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* Application manifest
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Module meta
'meta' => array(
// Module title, required
'title' => __('Vote'),
// Description, for admin, optional
'description' => __('Vote system'),
// Version number, required
'version' => '1.0.0',
// Distribution license, required
'license' => 'New BSD',
// Logo image, for admin, optional
'logo' => 'image/logo.png',
// Readme file, for admin, optional
'readme' => 'docs/readme.txt',
// Demo site link, optional
'demo' => 'http://demo.xoopsengine.org/vote'
'meta' => array(
'title' => __('Vote'),
'description' => __('Vote system'),
'version' => '1.1.0',
'license' => 'New BSD',
'logo' => 'image/logo.png',
'readme' => 'docs/readme.txt',
'demo' => 'http://demo.xoopsengine.org/news',
'icon' => 'fa-thumbs-up',
),
// Author information
'author' => array(
// Author full name, required
'name' => 'Hossein Azizabadi',
// Email address, optional
'email' => '[email protected]',
// Website link, optional
'website' => 'http://www.xoopsengine.org',
// Credits and aknowledgement, optional
'credits' => 'Zend Framework Team; Pi Engine Team'
),
// Module dependency: list of module directory names, optional
'dependency' => array(
'author' => array(
'Name' => 'Hossein Azizabadi',
'email' => '[email protected]',
'website' => 'http://www.xoopsengine.org',
'credits' => 'Pi Engine Team'
),
// Maintenance actions
'maintenance' => array(
// resource
'resource' => array(
// Database meta
'database' => 'database.php',
// Module configs
'config' => 'config.php',
// ACL specs
'acl' => 'acl.php',
// Bootstrap, priority
'bootstrap' => 1,
// Navigation definition
'navigation' => 'navigation.php',
)
// resource
'resource' => array(
'database' => 'database.php',
'config' => 'config.php',
'permission' => 'permission.php',
'page' => 'page.php',
'navigation' => 'navigation.php',
)
);
27 changes: 13 additions & 14 deletions config/navigation.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
<?php
/**
* Vote module config
* Pi Engine (http://pialog.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Copyright (c) Pi Engine http://www.xoopsengine.org
* @license http://www.xoopsengine.org/license New BSD License
* @author Hossein Azizabadi <[email protected]>
* @since 3.0
* @package Module\Vote
* @version $Id$
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
'admin' => array(
'last' => array(
'label' => __('Last votes'),
'permission' => array(
'resource' => 'index',
),
'route' => 'admin',
'controller' => 'index',
'action' => 'index',
),
'tools' => array(
'label' => __('Tools'),
'permission' => array(
'resource' => 'tools',
),
'route' => 'admin',
'controller' => 'tools',
'action' => 'index',
Expand Down
25 changes: 25 additions & 0 deletions config/page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Pi Engine (http://pialog.org)
*
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Admin section
'admin' => array(
array(
'controller' => 'index',
'permission' => 'index',
),
array(
'controller' => 'topic',
'permission' => 'topic',
),
),
);
29 changes: 29 additions & 0 deletions config/permission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Pi Engine (http://pialog.org)
*
* @link http://code.pialog.org for the Pi Engine source repository
* @copyright Copyright (c) Pi Engine http://pialog.org
* @license http://pialog.org/license.txt New BSD License
*/

/**
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Admin section
'admin' => array(
'index' => array(
'title' => _a('Index'),
'access' => array(
//'admin',
),
),
'tools' => array(
'title' => _a('Tools'),
'access' => array(
//'admin',
),
),
),
);
1 change: 1 addition & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added locale/en/default.mo
Binary file not shown.
Loading

0 comments on commit 5ee3223

Please sign in to comment.