Skip to content

Commit

Permalink
A bunch of changes
Browse files Browse the repository at this point in the history
Signed-off-by: Suki <suki@missallsunday.com>
  • Loading branch information
MissAllSunday committed Oct 20, 2013
1 parent a6b85ee commit 3b61511
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
51 changes: 25 additions & 26 deletions Sources/ModSite/ModSite.php
Expand Up @@ -81,11 +81,11 @@ function settings(&$return_config = false)

$config_vars = array(
array('desc', self::$className .'_admin_sub'),
array('check', self::$className .'_enable', 'subtext' => $txt['ModSite_enable_sub']),
array('int', self::$className .'_latest_limit', 'subtext' => $txt['ModSite_latest_limit_sub'], 'size' => 3),
array('int', self::$className .'_pag_limit', 'subtext' => $txt['ModSite_pag_limit_sub'], 'size' => 3),
array('text', self::$className .'_json_dir', 'subtext' => $txt['ModSite_json_dir_sub']),
array('text', self::$className .'_github_username', 'subtext' => $txt['ModSite_github_username_sub']),
array('check', self::$className .'_enable', 'subtext' => $this->text('enable_sub')),
array('int', self::$className .'_latest_limit', 'subtext' => $this->text('latest_limit_sub'), 'size' => 3),
array('int', self::$className .'_pag_limit', 'subtext' => $this->text('pag_limit_sub'), 'size' => 3),
array('text', self::$className .'_json_dir', 'subtext' => $this->text('json_dir_sub')),
array('text', self::$className .'_github_username', 'subtext' => $this->text('github_username_sub')),
array(
'select',
'ModSite_menu_position',
Expand All @@ -96,9 +96,9 @@ function settings(&$return_config = false)
'login' => $txt['login'],
'register' => $txt['register']
),
'subtext' => $txt['ModSite_menu_position_sub']
'subtext' => $this->text('menu_position_sub')
),
array('text', 'ModSite_download_path'),
array('text', self::$className .'_download_path'),
);

if ($return_config)
Expand All @@ -125,34 +125,33 @@ function settings(&$return_config = false)
prepareDBSettingContext($config_vars);
}

function modsite_permissions(&$permissionGroups, &$permissionList)
function permissions(&$permissionGroups, &$permissionList)
{
$permissionGroups['membergroup']['simple'] = array('ModSite_per_simple');
$permissionGroups['membergroup']['classic'] = array('ModSite_per_classic');
$permissionGroups['membergroup']['simple'] = array(self::$className .'_per_simple');
$permissionGroups['membergroup']['classic'] = array(self::$className .'_per_classic');

$permissionList['membergroup']['ModSite_view'] = array(
$permissionList['membergroup'][self::$className .'_view'] = array(
false,
'ModSite_per_classic',
'ModSite_per_simple');
self::$className .'_classic',
self::$className .'_per_simple');

$permissionList['membergroup']['ModSite_delete'] = array(
$permissionList['membergroup'][self::$className .'_delete'] = array(
false,
'ModSite_per_classic',
'ModSite_per_simple');
$permissionList['membergroup']['ModSite_add'] = array(
self::$className .'_per_classic',
self::$className .'_per_simple');
$permissionList['membergroup'][self::$className .'_add'] = array(
false,
'ModSite_per_classic',
'ModSite_per_simple');
$permissionList['membergroup']['ModSite_edit'] = array(
self::$className .'_per_classic',
self::$className .'_simple');
$permissionList['membergroup'][self::$className .'_edit'] = array(
false,
'ModSite_per_classic',
'ModSite_per_simple');
self::$className .'_per_classic',
self::$className .'_per_simple');
}

function modsite_dispatch()
function dispatch()
{
global $txt, $sourcedir, $modSettings, $context, $scripturl, $settings;
static $mainObj;
global $txt, $sourcedir, $context, $scripturl, $settings;

/* Safety first, hardcode the actions */
$subActions = array(
Expand Down Expand Up @@ -208,7 +207,7 @@ function toggleDiv(divid, obj){

$call = 'ModSite_' .(!empty($func) && in_array($func, array_values($subActions)) ? $func : 'main');

// Call the appropiate method if the mod is enable
// Call the appropriate method if the mod is enable
if (!empty($this->setting('enable')))
$call($mainObj);

Expand Down
Expand Up @@ -10,7 +10,7 @@
if (!defined('SMF'))
die('Hacking attempt...');

class ModSite extends ModSiteParser
class ModSitePages extends ModSite
{
protected $_table = array(
'name' => 'mod_site',
Expand Down
2 changes: 1 addition & 1 deletion Sources/ModSite/ModSiteParser.php
Expand Up @@ -10,7 +10,7 @@
if (!defined('SMF'))
die('Hacking attempt...');

class ModSiteParser
class ModSiteParser extends ModSite
{
protected $_jsonDir = '';
protected $_apiAcceptableStatus = array('good', 'minor');
Expand Down

0 comments on commit 3b61511

Please sign in to comment.