Skip to content

Commit

Permalink
Work on ask module
Browse files Browse the repository at this point in the history
  • Loading branch information
voltan committed Mar 29, 2015
1 parent 96c38e5 commit 3a2b440
Show file tree
Hide file tree
Showing 37 changed files with 1,148 additions and 549 deletions.
1 change: 0 additions & 1 deletion asset/css/admin.css
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

130 changes: 75 additions & 55 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,94 +10,114 @@
/**
* @author Hossein Azizabadi <[email protected]>
*/

return array(
'category' => array(
array(
'title' => __('Admin'),
'name' => 'admin'
'title' => _a('Admin'),
'name' => 'admin'
),
array(
'title' => _a('Show'),
'name' => 'show'
),
array(
'title' => __('Front'),
'name' => 'front'
'title' => _a('Question'),
'name' => 'question'
),
array(
'title' => __('Feed'),
'name' => 'feed'
'title' => _a('Feed'),
'name' => 'feed'
),
array(
'title' => __('Vote'),
'name' => 'vote'
'title' => _a('Vote'),
'name' => 'vote'
),
),
'item' => array(
// Admin
'admin_perpage' => array(
'category' => 'admin',
'title' => __('Perpage'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 25
'category' => 'admin',
'title' => _a('Perpage'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 50
),
// Show
'show_perpage' => array(
'category' => 'front',
'title' => __('Perpage'),
'description' => __('Number of questions in each page'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 10
'category' => 'show',
'title' => _a('Perpage'),
'description' => _a('Number of questions in each page'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 10
),
'show_tags' => array(
'category' => 'front',
'title' => __('Tags'),
'description' => __('Number of tags in tag controller'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 50
'category' => 'show',
'title' => _a('Tags'),
'description' => _a('Number of tags in tag controller'),
'edit' => 'text',
'filter' => 'number_int',
'value' => 50
),
'view_breadcrumbs' => array(
'category' => 'show',
'title' => _a('Show breadcrumbs'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
// Question
'question_answer' => array(
'category' => 'question',
'title' => _a('Can answer'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'auto_approval' => array(
'title' => __('Automatic approval'),
'description' => '',
'edit' => array(
'type' => 'select',
'options' => array(
'title' => _a('Automatic approval'),
'description' => '',
'edit' => array(
'type' => 'select',
'options' => array(
'options' => array(
0 => __('All questions and answers need admin review before publish'),
1 => __('Automatic approval all questions and answers'),
0 => _a('All questions and answers need admin review before publish'),
1 => _a('Automatic approval all questions and answers'),
),
),
),
'filter' => 'number_int',
'value' => 1,
'category' => 'front',
'filter' => 'number_int',
'value' => 1,
'category' => 'question',
),
// Feed
'feed_icon' => array(
'category' => 'feed',
'title' => __('Show feed icon'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
'category' => 'feed',
'title' => _a('Show feed icon'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
'feed_num' => array(
'category' => 'feed',
'title' => __('Feed number'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 10
'category' => 'feed',
'title' => _a('Feed number'),
'description' => '',
'edit' => 'text',
'filter' => 'number_int',
'value' => 10
),
// Vote
'vote_bar' => array(
'category' => 'vote',
'title' => __('Use vote system'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
'category' => 'vote',
'title' => _a('Use vote system'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1
),
),
);
19 changes: 10 additions & 9 deletions config/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/
return array(
'meta' => array(
'title' => __('Ask'),
'description' => __('Ask and Answer'),
'version' => '0.0.8',
'title' => _a('Ask'),
'description' => _a('Ask and Answer'),
'version' => '0.1.0',
'license' => 'New BSD',
'logo' => 'image/logo.png',
'readme' => 'docs/readme.txt',
Expand All @@ -24,17 +24,18 @@
),
// Author information
'author' => array(
'dev' => 'Hossein Azizabadi',
'email' => '[email protected]',
'architect' => '@voltan',
'design' => '@voltan'
'dev' => 'Hossein Azizabadi',
'email' => '[email protected]',
'architect' => '@voltan',
'design' => '@voltan'
),
// Resource
'resource' => array(
'resource' => array(
'database' => 'database.php',
'config' => 'config.php',
'permission' => 'permission.php',
'page' => 'page.php',
'navigation' => 'navigation.php',
'route' => 'route.php',
),
)
);
12 changes: 9 additions & 3 deletions config/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@
*/
return array(
'admin' => array(
'last' => array(
'label' => __('List of Question'),
'question' => array(
'label' => _a('List of Questions'),
'permission' => array(
'resource' => 'question',
),
'route' => 'admin',
'module' => 'ask',
'controller' => 'question',
'action' => 'index',
),
'tools' => array(
'label' => __('Tools'),
'label' => _a('Tools'),
'permission' => array(
'resource' => 'tools',
),
'route' => 'admin',
'module' => 'ask',
'controller' => 'tools',
Expand Down
25 changes: 24 additions & 1 deletion config/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,49 @@
* @author Hossein Azizabadi <[email protected]>
*/
return array(
// Front section
// Admin section
'admin' => array(
array(
'title' => _a('List of Questions'),
'controller' => 'question',
'permission' => 'question',
),
array(
'title' => _a('Tools'),
'controller' => 'tools',
'permission' => 'tools',
),
),
// Front section
'front' => array(
array(
'title' => _a('Index page'),
'controller' => 'index',
'permission' => 'public',
'block' => 1,
),
array(
'title' => _a('Answer'),
'controller' => 'answer',
'permission' => 'answer',
'block' => 1,
),
array(
'title' => _a('Question'),
'controller' => 'question',
'permission' => 'public',
'block' => 1,
),
array(
'title' => _a('Submit question'),
'controller' => 'submit',
'permission' => 'submit',
'block' => 1,
),
array(
'title' => _a('Tag'),
'controller' => 'tag',
'permission' => 'public',
'block' => 1,
),
),
Expand Down
82 changes: 82 additions & 0 deletions config/permission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?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(
// Front section
'front' => array(
'public' => array(
'title' => _a('Global public resource'),
'access' => array(
'guest',
'member',
),
),
'author' => array(
'title' => _a('Authors'),
'access' => array(
'guest',
'member',
),
),
'favourite' => array(
'title' => _a('Favourite'),
'access' => array(
'member',
),
),
),
// Admin section
'admin' => array(
'attach' => array(
'title' => _a('Attach'),
'access' => array(
//'admin',
),
),
'author' => array(
'title' => _a('Authors'),
'access' => array(
//'admin',
),
),
'extra' => array(
'title' => _a('Extra'),
'access' => array(
//'admin',
),
),
'spotlight' => array(
'title' => _a('Spotlight'),
'access' => array(
//'admin',
),
),
'story' => array(
'title' => _a('Story'),
'access' => array(
//'admin',
),
),
'topic' => array(
'title' => _a('Topic'),
'access' => array(
//'admin',
),
),
'tools' => array(
'title' => _a('Tools'),
'access' => array(
//'admin',
),
),
),
);
Binary file added locale/en/admin.mo
Binary file not shown.
Loading

0 comments on commit 3a2b440

Please sign in to comment.