Passed
Push — master ( 62ffb0...86de2c )
by Goffy
03:49
created
class/Permissions.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -32,25 +32,25 @@
 block discarded – undo
32 32
  */
33 33
 class Permissions extends \XoopsObject
34 34
 {
35
-	/**
36
-	 * Constructor
37
-	 *
38
-	 * @param null
39
-	 */
40
-	public function __construct()
41
-	{
42
-	}
43
-
44
-	/**
45
-	 * @static function &getInstance
46
-	 *
47
-	 * @param null
48
-	 */
49
-	public static function getInstance()
50
-	{
51
-		static $instance = false;
52
-		if (!$instance) {
53
-			$instance = new self();
54
-		}
55
-	}
35
+    /**
36
+     * Constructor
37
+     *
38
+     * @param null
39
+     */
40
+    public function __construct()
41
+    {
42
+    }
43
+
44
+    /**
45
+     * @static function &getInstance
46
+     *
47
+     * @param null
48
+     */
49
+    public static function getInstance()
50
+    {
51
+        static $instance = false;
52
+        if (!$instance) {
53
+            $instance = new self();
54
+        }
55
+    }
56 56
 }
Please login to merge, or discard this patch.
class/DirectoriesHandler.php 1 patch
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -31,94 +31,94 @@
 block discarded – undo
31 31
  */
32 32
 class DirectoriesHandler extends \XoopsPersistableObjectHandler
33 33
 {
34
-	/**
35
-	 * Constructor
36
-	 *
37
-	 * @param \XoopsDatabase $db
38
-	 */
39
-	public function __construct(\XoopsDatabase $db)
40
-	{
41
-		parent::__construct($db, 'wggithub_directories', Directories::class, 'dir_id', 'dir_name');
42
-	}
34
+    /**
35
+     * Constructor
36
+     *
37
+     * @param \XoopsDatabase $db
38
+     */
39
+    public function __construct(\XoopsDatabase $db)
40
+    {
41
+        parent::__construct($db, 'wggithub_directories', Directories::class, 'dir_id', 'dir_name');
42
+    }
43 43
 
44
-	/**
45
-	 * @param bool $isNew
46
-	 *
47
-	 * @return object
48
-	 */
49
-	public function create($isNew = true)
50
-	{
51
-		return parent::create($isNew);
52
-	}
44
+    /**
45
+     * @param bool $isNew
46
+     *
47
+     * @return object
48
+     */
49
+    public function create($isNew = true)
50
+    {
51
+        return parent::create($isNew);
52
+    }
53 53
 
54
-	/**
55
-	 * retrieve a field
56
-	 *
57
-	 * @param int $i field id
58
-	 * @param null fields
59
-	 * @return mixed reference to the {@link Get} object
60
-	 */
61
-	public function get($i = null, $fields = null)
62
-	{
63
-		return parent::get($i, $fields);
64
-	}
54
+    /**
55
+     * retrieve a field
56
+     *
57
+     * @param int $i field id
58
+     * @param null fields
59
+     * @return mixed reference to the {@link Get} object
60
+     */
61
+    public function get($i = null, $fields = null)
62
+    {
63
+        return parent::get($i, $fields);
64
+    }
65 65
 
66
-	/**
67
-	 * get inserted id
68
-	 *
69
-	 * @param null
70
-	 * @return int reference to the {@link Get} object
71
-	 */
72
-	public function getInsertId()
73
-	{
74
-		return $this->db->getInsertId();
75
-	}
66
+    /**
67
+     * get inserted id
68
+     *
69
+     * @param null
70
+     * @return int reference to the {@link Get} object
71
+     */
72
+    public function getInsertId()
73
+    {
74
+        return $this->db->getInsertId();
75
+    }
76 76
 
77
-	/**
78
-	 * Get Count Directories in the database
79
-	 * @param int    $start
80
-	 * @param int    $limit
81
-	 * @param string $sort
82
-	 * @param string $order
83
-	 * @return int
84
-	 */
85
-	public function getCountDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC')
86
-	{
87
-		$crCountDirectories = new \CriteriaCompo();
88
-		$crCountDirectories = $this->getDirectoriesCriteria($crCountDirectories, $start, $limit, $sort, $order);
89
-		return $this->getCount($crCountDirectories);
90
-	}
77
+    /**
78
+     * Get Count Directories in the database
79
+     * @param int    $start
80
+     * @param int    $limit
81
+     * @param string $sort
82
+     * @param string $order
83
+     * @return int
84
+     */
85
+    public function getCountDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC')
86
+    {
87
+        $crCountDirectories = new \CriteriaCompo();
88
+        $crCountDirectories = $this->getDirectoriesCriteria($crCountDirectories, $start, $limit, $sort, $order);
89
+        return $this->getCount($crCountDirectories);
90
+    }
91 91
 
92
-	/**
93
-	 * Get All Directories in the database
94
-	 * @param int    $start
95
-	 * @param int    $limit
96
-	 * @param string $sort
97
-	 * @param string $order
98
-	 * @return array
99
-	 */
100
-	public function getAllDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC')
101
-	{
102
-		$crAllDirectories = new \CriteriaCompo();
103
-		$crAllDirectories = $this->getDirectoriesCriteria($crAllDirectories, $start, $limit, $sort, $order);
104
-		return $this->getAll($crAllDirectories);
105
-	}
92
+    /**
93
+     * Get All Directories in the database
94
+     * @param int    $start
95
+     * @param int    $limit
96
+     * @param string $sort
97
+     * @param string $order
98
+     * @return array
99
+     */
100
+    public function getAllDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC')
101
+    {
102
+        $crAllDirectories = new \CriteriaCompo();
103
+        $crAllDirectories = $this->getDirectoriesCriteria($crAllDirectories, $start, $limit, $sort, $order);
104
+        return $this->getAll($crAllDirectories);
105
+    }
106 106
 
107
-	/**
108
-	 * Get Criteria Directories
109
-	 * @param        $crDirectories
110
-	 * @param int    $start
111
-	 * @param int    $limit
112
-	 * @param string $sort
113
-	 * @param string $order
114
-	 * @return int
115
-	 */
116
-	private function getDirectoriesCriteria($crDirectories, $start, $limit, $sort, $order)
117
-	{
118
-		$crDirectories->setStart($start);
119
-		$crDirectories->setLimit($limit);
120
-		$crDirectories->setSort($sort);
121
-		$crDirectories->setOrder($order);
122
-		return $crDirectories;
123
-	}
107
+    /**
108
+     * Get Criteria Directories
109
+     * @param        $crDirectories
110
+     * @param int    $start
111
+     * @param int    $limit
112
+     * @param string $sort
113
+     * @param string $order
114
+     * @return int
115
+     */
116
+    private function getDirectoriesCriteria($crDirectories, $start, $limit, $sort, $order)
117
+    {
118
+        $crDirectories->setStart($start);
119
+        $crDirectories->setLimit($limit);
120
+        $crDirectories->setSort($sort);
121
+        $crDirectories->setOrder($order);
122
+        return $crDirectories;
123
+    }
124 124
 }
Please login to merge, or discard this patch.
blocks/repositories.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -33,61 +33,61 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function b_wggithub_repositories_show($options)
35 35
 {
36
-	include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php';
37
-	$myts = MyTextSanitizer::getInstance();
38
-	$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
39
-	$block       = [];
40
-	$typeBlock   = $options[0];
41
-	$limit       = $options[1];
42
-	$lenghtTitle = $options[2];
43
-	$helper      = Helper::getInstance();
44
-	$repositoriesHandler = $helper->getHandler('Repositories');
45
-	$crRepositories = new \CriteriaCompo();
46
-	\array_shift($options);
47
-	\array_shift($options);
48
-	\array_shift($options);
36
+    include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php';
37
+    $myts = MyTextSanitizer::getInstance();
38
+    $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
39
+    $block       = [];
40
+    $typeBlock   = $options[0];
41
+    $limit       = $options[1];
42
+    $lenghtTitle = $options[2];
43
+    $helper      = Helper::getInstance();
44
+    $repositoriesHandler = $helper->getHandler('Repositories');
45
+    $crRepositories = new \CriteriaCompo();
46
+    \array_shift($options);
47
+    \array_shift($options);
48
+    \array_shift($options);
49 49
 
50
-	switch ($typeBlock) {
51
-		case 'last':
52
-		default:
53
-			// For the block: repositories last
54
-			$crRepositories->setSort('repo_datecreated');
55
-			$crRepositories->setOrder('DESC');
56
-			break;
57
-		case 'new':
58
-			// For the block: repositories new
59
-			$crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING), '>='));
60
-			$crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING) + 86400, '<='));
61
-			$crRepositories->setSort('repo_datecreated');
62
-			$crRepositories->setOrder('ASC');
63
-			break;
64
-		case 'hits':
65
-			// For the block: repositories hits
66
-			$crRepositories->setSort('repo_hits');
67
-			$crRepositories->setOrder('DESC');
68
-			break;
69
-		case 'top':
70
-			// For the block: repositories top
71
-			$crRepositories->setSort('repo_top');
72
-			$crRepositories->setOrder('ASC');
73
-			break;
74
-		case 'random':
75
-			// For the block: repositories random
76
-			$crRepositories->setSort('RAND()');
77
-			break;
78
-	}
50
+    switch ($typeBlock) {
51
+        case 'last':
52
+        default:
53
+            // For the block: repositories last
54
+            $crRepositories->setSort('repo_datecreated');
55
+            $crRepositories->setOrder('DESC');
56
+            break;
57
+        case 'new':
58
+            // For the block: repositories new
59
+            $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING), '>='));
60
+            $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING) + 86400, '<='));
61
+            $crRepositories->setSort('repo_datecreated');
62
+            $crRepositories->setOrder('ASC');
63
+            break;
64
+        case 'hits':
65
+            // For the block: repositories hits
66
+            $crRepositories->setSort('repo_hits');
67
+            $crRepositories->setOrder('DESC');
68
+            break;
69
+        case 'top':
70
+            // For the block: repositories top
71
+            $crRepositories->setSort('repo_top');
72
+            $crRepositories->setOrder('ASC');
73
+            break;
74
+        case 'random':
75
+            // For the block: repositories random
76
+            $crRepositories->setSort('RAND()');
77
+            break;
78
+    }
79 79
 
80
-	$crRepositories->setLimit($limit);
81
-	$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
82
-	unset($crRepositories);
83
-	if (\count($repositoriesAll) > 0) {
84
-		foreach (\array_keys($repositoriesAll) as $i) {
85
-			$block[$i]['name'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_name'));
86
-			$block[$i]['htmlurl'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_htmlurl'));
87
-		}
88
-	}
80
+    $crRepositories->setLimit($limit);
81
+    $repositoriesAll = $repositoriesHandler->getAll($crRepositories);
82
+    unset($crRepositories);
83
+    if (\count($repositoriesAll) > 0) {
84
+        foreach (\array_keys($repositoriesAll) as $i) {
85
+            $block[$i]['name'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_name'));
86
+            $block[$i]['htmlurl'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_htmlurl'));
87
+        }
88
+    }
89 89
 
90
-	return $block;
90
+    return $block;
91 91
 
92 92
 }
93 93
 
@@ -98,32 +98,32 @@  discard block
 block discarded – undo
98 98
  */
99 99
 function b_wggithub_repositories_edit($options)
100 100
 {
101
-	include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php';
102
-	$helper = Helper::getInstance();
103
-	$repositoriesHandler = $helper->getHandler('Repositories');
104
-	$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
105
-	$form = _MB_WGGITHUB_DISPLAY;
106
-	$form .= "<input type='hidden' name='options[0]' value='".$options[0]."' />";
107
-	$form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' />&nbsp;<br>";
108
-	$form .= _MB_WGGITHUB_TITLE_LENGTH . " : <input type='text' name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' /><br><br>";
109
-	\array_shift($options);
110
-	\array_shift($options);
111
-	\array_shift($options);
101
+    include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php';
102
+    $helper = Helper::getInstance();
103
+    $repositoriesHandler = $helper->getHandler('Repositories');
104
+    $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
105
+    $form = _MB_WGGITHUB_DISPLAY;
106
+    $form .= "<input type='hidden' name='options[0]' value='".$options[0]."' />";
107
+    $form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' />&nbsp;<br>";
108
+    $form .= _MB_WGGITHUB_TITLE_LENGTH . " : <input type='text' name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' /><br><br>";
109
+    \array_shift($options);
110
+    \array_shift($options);
111
+    \array_shift($options);
112 112
 
113
-	$crRepositories = new \CriteriaCompo();
114
-	$crRepositories->add(new \Criteria('repo_id', 0, '!='));
115
-	$crRepositories->setSort('repo_id');
116
-	$crRepositories->setOrder('ASC');
117
-	$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
118
-	unset($crRepositories);
119
-	$form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY . "<br><select name='options[]' multiple='multiple' size='5'>";
120
-	$form .= "<option value='0' " . (\in_array(0, $options) == false ? '' : "selected='selected'") . '>' . _MB_WGGITHUB_ALL_REPOSITORIES . '</option>';
121
-	foreach (\array_keys($repositoriesAll) as $i) {
122
-		$repo_id = $repositoriesAll[$i]->getVar('repo_id');
123
-		$form .= "<option value='" . $repo_id . "' " . (\in_array($repo_id, $options) == false ? '' : "selected='selected'") . '>' . $repositoriesAll[$i]->getVar('repo_name') . '</option>';
124
-	}
125
-	$form .= '</select>';
113
+    $crRepositories = new \CriteriaCompo();
114
+    $crRepositories->add(new \Criteria('repo_id', 0, '!='));
115
+    $crRepositories->setSort('repo_id');
116
+    $crRepositories->setOrder('ASC');
117
+    $repositoriesAll = $repositoriesHandler->getAll($crRepositories);
118
+    unset($crRepositories);
119
+    $form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY . "<br><select name='options[]' multiple='multiple' size='5'>";
120
+    $form .= "<option value='0' " . (\in_array(0, $options) == false ? '' : "selected='selected'") . '>' . _MB_WGGITHUB_ALL_REPOSITORIES . '</option>';
121
+    foreach (\array_keys($repositoriesAll) as $i) {
122
+        $repo_id = $repositoriesAll[$i]->getVar('repo_id');
123
+        $form .= "<option value='" . $repo_id . "' " . (\in_array($repo_id, $options) == false ? '' : "selected='selected'") . '>' . $repositoriesAll[$i]->getVar('repo_name') . '</option>';
124
+    }
125
+    $form .= '</select>';
126 126
 
127
-	return $form;
127
+    return $form;
128 128
 
129 129
 }
Please login to merge, or discard this patch.
config/config.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -27,34 +27,34 @@
 block discarded – undo
27 27
 $moduleDirName  = \basename(\dirname(__DIR__));
28 28
 $moduleDirNameUpper  = \mb_strtoupper($moduleDirName);
29 29
 return (object)[
30
-	'name'           => \mb_strtoupper($moduleDirName) . ' Module Configurator',
31
-	'paths'          => [
32
-		'dirname'    => $moduleDirName,
33
-		'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
34
-		'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
35
-		'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
36
-		'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
37
-		'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
38
-	],
39
-	'uploadFolders'  => [
40
-		XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
41
-	],
42
-	'copyBlankFiles'  => [
43
-	],
44
-	'copyTestFolders'  => [
45
-		[XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads',
46
-		XOOPS_UPLOAD_PATH . '/' . $moduleDirName],
47
-	],
48
-	'templateFolders'  => [
49
-		'/templates/',
50
-	],
51
-	'oldFiles'  => [
52
-	],
53
-	'oldFolders'  => [
54
-	],
55
-	'renameTables'  => [
56
-	],
57
-	'moduleStats'  => [
58
-	],
59
-	'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='" . XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>",
30
+    'name'           => \mb_strtoupper($moduleDirName) . ' Module Configurator',
31
+    'paths'          => [
32
+        'dirname'    => $moduleDirName,
33
+        'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
34
+        'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
35
+        'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
36
+        'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
37
+        'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
38
+    ],
39
+    'uploadFolders'  => [
40
+        XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
41
+    ],
42
+    'copyBlankFiles'  => [
43
+    ],
44
+    'copyTestFolders'  => [
45
+        [XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads',
46
+        XOOPS_UPLOAD_PATH . '/' . $moduleDirName],
47
+    ],
48
+    'templateFolders'  => [
49
+        '/templates/',
50
+    ],
51
+    'oldFiles'  => [
52
+    ],
53
+    'oldFolders'  => [
54
+    ],
55
+    'renameTables'  => [
56
+    ],
57
+    'moduleStats'  => [
58
+    ],
59
+    'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='" . XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>",
60 60
 ];
Please login to merge, or discard this patch.
readmes.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -45,38 +45,38 @@
 block discarded – undo
45 45
 $GLOBALS['xoopsTpl']->assign('showItem', $rmId > 0);
46 46
 
47 47
 switch ($op) {
48
-	case 'show':
49
-	case 'list':
50
-	default:
51
-		$crReadmes = new \CriteriaCompo();
52
-		if ($rmId > 0) {
53
-			$crReadmes->add(new \Criteria('rm_id', $rmId));
54
-		}
55
-		$readmesCount = $readmesHandler->getCount($crReadmes);
56
-		$GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount);
57
-		$crReadmes->setStart($start);
58
-		$crReadmes->setLimit($limit);
59
-		$readmesAll = $readmesHandler->getAll($crReadmes);
60
-		if ($readmesCount > 0) {
61
-			$readmes = [];
62
-			// Get All Readmes
63
-			foreach (\array_keys($readmesAll) as $i) {
64
-				$readmes[$i] = $readmesAll[$i]->getValuesReadmes();
65
-				$keywords[$i] = $readmesAll[$i]->getVar('rm_name');
66
-			}
67
-			$GLOBALS['xoopsTpl']->assign('readmes', $readmes);
68
-			unset($readmes);
69
-			// Display Navigation
70
-			if ($readmesCount > $limit) {
71
-				include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
-				$pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
73
-				$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74
-			}
75
-			$GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
76
-			$GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby'));
77
-			$GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col'));
78
-		}
79
-		break;
48
+    case 'show':
49
+    case 'list':
50
+    default:
51
+        $crReadmes = new \CriteriaCompo();
52
+        if ($rmId > 0) {
53
+            $crReadmes->add(new \Criteria('rm_id', $rmId));
54
+        }
55
+        $readmesCount = $readmesHandler->getCount($crReadmes);
56
+        $GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount);
57
+        $crReadmes->setStart($start);
58
+        $crReadmes->setLimit($limit);
59
+        $readmesAll = $readmesHandler->getAll($crReadmes);
60
+        if ($readmesCount > 0) {
61
+            $readmes = [];
62
+            // Get All Readmes
63
+            foreach (\array_keys($readmesAll) as $i) {
64
+                $readmes[$i] = $readmesAll[$i]->getValuesReadmes();
65
+                $keywords[$i] = $readmesAll[$i]->getVar('rm_name');
66
+            }
67
+            $GLOBALS['xoopsTpl']->assign('readmes', $readmes);
68
+            unset($readmes);
69
+            // Display Navigation
70
+            if ($readmesCount > $limit) {
71
+                include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
+                $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
73
+                $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74
+            }
75
+            $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
76
+            $GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby'));
77
+            $GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col'));
78
+        }
79
+        break;
80 80
 }
81 81
 
82 82
 // Breadcrumbs
Please login to merge, or discard this patch.
admin/directories.php 1 patch
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -31,109 +31,109 @@
 block discarded – undo
31 31
 // Request dir_id
32 32
 $dirId = Request::getInt('dir_id');
33 33
 switch ($op) {
34
-	case 'list':
35
-	default:
36
-		// Define Stylesheet
37
-		$GLOBALS['xoTheme']->addStylesheet($style, null);
38
-		$start = Request::getInt('start', 0);
39
-		$limit = Request::getInt('limit', $helper->getConfig('adminpager'));
40
-		$templateMain = 'wggithub_admin_directories.tpl';
41
-		$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
42
-		$adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add');
43
-		$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
44
-		$directoriesCount = $directoriesHandler->getCountDirectories();
45
-		$directoriesAll = $directoriesHandler->getAllDirectories($start, $limit);
46
-		$GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount);
47
-		$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
48
-		$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
49
-		// Table view directories
50
-		if ($directoriesCount > 0) {
51
-			foreach (\array_keys($directoriesAll) as $i) {
52
-				$directory = $directoriesAll[$i]->getValuesDirectories();
53
-				$GLOBALS['xoopsTpl']->append('directories_list', $directory);
54
-				unset($directory);
55
-			}
56
-			// Display Navigation
57
-			if ($directoriesCount > $limit) {
58
-				include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
59
-				$pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
60
-				$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
61
-			}
62
-		} else {
63
-			$GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_DIRECTORIES);
64
-		}
65
-		break;
66
-	case 'new':
67
-		$templateMain = 'wggithub_admin_directories.tpl';
68
-		$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
69
-		$adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list');
70
-		$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
71
-		// Form Create
72
-		$directoriesObj = $directoriesHandler->create();
73
-		$form = $directoriesObj->getFormDirectories();
74
-		$GLOBALS['xoopsTpl']->assign('form', $form->render());
75
-		break;
76
-	case 'save':
77
-		// Security Check
78
-		if (!$GLOBALS['xoopsSecurity']->check()) {
79
-			\redirect_header('directories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
80
-		}
81
-		if ($dirId > 0) {
82
-			$directoriesObj = $directoriesHandler->get($dirId);
83
-		} else {
84
-			$directoriesObj = $directoriesHandler->create();
85
-		}
86
-		// Set Vars
87
-		$directoriesObj->setVar('dir_name', Request::getString('dir_name', ''));
88
-		$directoriesObj->setVar('dir_type', Request::getInt('dir_type', 0));
89
-		$directoriesObj->setVar('dir_autoupdate', Request::getInt('dir_autoupdate', 0));
90
-		$directoriesObj->setVar('dir_online', Request::getInt('dir_online', 0));
34
+    case 'list':
35
+    default:
36
+        // Define Stylesheet
37
+        $GLOBALS['xoTheme']->addStylesheet($style, null);
38
+        $start = Request::getInt('start', 0);
39
+        $limit = Request::getInt('limit', $helper->getConfig('adminpager'));
40
+        $templateMain = 'wggithub_admin_directories.tpl';
41
+        $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
42
+        $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add');
43
+        $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
44
+        $directoriesCount = $directoriesHandler->getCountDirectories();
45
+        $directoriesAll = $directoriesHandler->getAllDirectories($start, $limit);
46
+        $GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount);
47
+        $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
48
+        $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
49
+        // Table view directories
50
+        if ($directoriesCount > 0) {
51
+            foreach (\array_keys($directoriesAll) as $i) {
52
+                $directory = $directoriesAll[$i]->getValuesDirectories();
53
+                $GLOBALS['xoopsTpl']->append('directories_list', $directory);
54
+                unset($directory);
55
+            }
56
+            // Display Navigation
57
+            if ($directoriesCount > $limit) {
58
+                include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
59
+                $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
60
+                $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
61
+            }
62
+        } else {
63
+            $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_DIRECTORIES);
64
+        }
65
+        break;
66
+    case 'new':
67
+        $templateMain = 'wggithub_admin_directories.tpl';
68
+        $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
69
+        $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list');
70
+        $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
71
+        // Form Create
72
+        $directoriesObj = $directoriesHandler->create();
73
+        $form = $directoriesObj->getFormDirectories();
74
+        $GLOBALS['xoopsTpl']->assign('form', $form->render());
75
+        break;
76
+    case 'save':
77
+        // Security Check
78
+        if (!$GLOBALS['xoopsSecurity']->check()) {
79
+            \redirect_header('directories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
80
+        }
81
+        if ($dirId > 0) {
82
+            $directoriesObj = $directoriesHandler->get($dirId);
83
+        } else {
84
+            $directoriesObj = $directoriesHandler->create();
85
+        }
86
+        // Set Vars
87
+        $directoriesObj->setVar('dir_name', Request::getString('dir_name', ''));
88
+        $directoriesObj->setVar('dir_type', Request::getInt('dir_type', 0));
89
+        $directoriesObj->setVar('dir_autoupdate', Request::getInt('dir_autoupdate', 0));
90
+        $directoriesObj->setVar('dir_online', Request::getInt('dir_online', 0));
91 91
         $directoriesObj->setVar('dir_filterrelease', Request::getInt('dir_filterrelease', 0));
92
-		$directoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('dir_datecreated'));
93
-		$directoriesObj->setVar('dir_datecreated', $directoryDatecreatedObj->getTimestamp());
94
-		$directoriesObj->setVar('dir_submitter', Request::getInt('dir_submitter', 0));
95
-		// Insert Data
96
-		if ($directoriesHandler->insert($directoriesObj)) {
97
-			\redirect_header('directories.php?op=list', 2, _AM_WGGITHUB_FORM_OK);
98
-		}
99
-		// Get Form
100
-		$GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors());
101
-		$form = $directoriesObj->getFormDirectories();
102
-		$GLOBALS['xoopsTpl']->assign('form', $form->render());
103
-		break;
104
-	case 'edit':
105
-		$templateMain = 'wggithub_admin_directories.tpl';
106
-		$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
107
-		$adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add');
108
-		$adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list');
109
-		$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
110
-		// Get Form
111
-		$directoriesObj = $directoriesHandler->get($dirId);
112
-		$form = $directoriesObj->getFormDirectories();
113
-		$GLOBALS['xoopsTpl']->assign('form', $form->render());
114
-		break;
115
-	case 'delete':
116
-		$templateMain = 'wggithub_admin_directories.tpl';
117
-		$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
118
-		$directoriesObj = $directoriesHandler->get($dirId);
119
-		$dirName = $directoriesObj->getVar('dir_name');
120
-		if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
121
-			if (!$GLOBALS['xoopsSecurity']->check()) {
122
-				\redirect_header('directories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors()));
123
-			}
124
-			if ($directoriesHandler->delete($directoriesObj)) {
125
-				\redirect_header('directories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK);
126
-			} else {
127
-				$GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors());
128
-			}
129
-		} else {
130
-			$xoopsconfirm = new Common\XoopsConfirm(
131
-				['ok' => 1, 'dir_id' => $dirId, 'op' => 'delete'],
132
-				$_SERVER['REQUEST_URI'],
133
-				\sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $directoriesObj->getVar('dir_name')));
134
-			$form = $xoopsconfirm->getFormXoopsConfirm();
135
-			$GLOBALS['xoopsTpl']->assign('form', $form->render());
136
-		}
137
-		break;
92
+        $directoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('dir_datecreated'));
93
+        $directoriesObj->setVar('dir_datecreated', $directoryDatecreatedObj->getTimestamp());
94
+        $directoriesObj->setVar('dir_submitter', Request::getInt('dir_submitter', 0));
95
+        // Insert Data
96
+        if ($directoriesHandler->insert($directoriesObj)) {
97
+            \redirect_header('directories.php?op=list', 2, _AM_WGGITHUB_FORM_OK);
98
+        }
99
+        // Get Form
100
+        $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors());
101
+        $form = $directoriesObj->getFormDirectories();
102
+        $GLOBALS['xoopsTpl']->assign('form', $form->render());
103
+        break;
104
+    case 'edit':
105
+        $templateMain = 'wggithub_admin_directories.tpl';
106
+        $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
107
+        $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add');
108
+        $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list');
109
+        $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
110
+        // Get Form
111
+        $directoriesObj = $directoriesHandler->get($dirId);
112
+        $form = $directoriesObj->getFormDirectories();
113
+        $GLOBALS['xoopsTpl']->assign('form', $form->render());
114
+        break;
115
+    case 'delete':
116
+        $templateMain = 'wggithub_admin_directories.tpl';
117
+        $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
118
+        $directoriesObj = $directoriesHandler->get($dirId);
119
+        $dirName = $directoriesObj->getVar('dir_name');
120
+        if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
121
+            if (!$GLOBALS['xoopsSecurity']->check()) {
122
+                \redirect_header('directories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors()));
123
+            }
124
+            if ($directoriesHandler->delete($directoriesObj)) {
125
+                \redirect_header('directories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK);
126
+            } else {
127
+                $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors());
128
+            }
129
+        } else {
130
+            $xoopsconfirm = new Common\XoopsConfirm(
131
+                ['ok' => 1, 'dir_id' => $dirId, 'op' => 'delete'],
132
+                $_SERVER['REQUEST_URI'],
133
+                \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $directoriesObj->getVar('dir_name')));
134
+            $form = $xoopsconfirm->getFormXoopsConfirm();
135
+            $GLOBALS['xoopsTpl']->assign('form', $form->render());
136
+        }
137
+        break;
138 138
 }
139 139
 require __DIR__ . '/footer.php';
Please login to merge, or discard this patch.
class/Directories.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -33,74 +33,74 @@  discard block
 block discarded – undo
33 33
  */
34 34
 class Directories extends \XoopsObject
35 35
 {
36
-	/**
37
-	 * Constructor
38
-	 *
39
-	 * @param null
40
-	 */
41
-	public function __construct()
42
-	{
43
-		$this->initVar('dir_id', \XOBJ_DTYPE_INT);
44
-		$this->initVar('dir_name', \XOBJ_DTYPE_TXTBOX);
45
-		$this->initVar('dir_type', \XOBJ_DTYPE_INT);
36
+    /**
37
+     * Constructor
38
+     *
39
+     * @param null
40
+     */
41
+    public function __construct()
42
+    {
43
+        $this->initVar('dir_id', \XOBJ_DTYPE_INT);
44
+        $this->initVar('dir_name', \XOBJ_DTYPE_TXTBOX);
45
+        $this->initVar('dir_type', \XOBJ_DTYPE_INT);
46 46
         $this->initVar('dir_autoupdate', XOBJ_DTYPE_INT);
47 47
         $this->initVar('dir_online', XOBJ_DTYPE_INT);
48 48
         $this->initVar('dir_filterrelease', XOBJ_DTYPE_INT);
49
-		$this->initVar('dir_datecreated', \XOBJ_DTYPE_INT);
50
-		$this->initVar('dir_submitter', \XOBJ_DTYPE_INT);
51
-	}
49
+        $this->initVar('dir_datecreated', \XOBJ_DTYPE_INT);
50
+        $this->initVar('dir_submitter', \XOBJ_DTYPE_INT);
51
+    }
52 52
 
53
-	/**
54
-	 * @static function &getInstance
55
-	 *
56
-	 * @param null
57
-	 */
58
-	public static function getInstance()
59
-	{
60
-		static $instance = false;
61
-		if (!$instance) {
62
-			$instance = new self();
63
-		}
64
-	}
53
+    /**
54
+     * @static function &getInstance
55
+     *
56
+     * @param null
57
+     */
58
+    public static function getInstance()
59
+    {
60
+        static $instance = false;
61
+        if (!$instance) {
62
+            $instance = new self();
63
+        }
64
+    }
65 65
 
66
-	/**
67
-	 * The new inserted $Id
68
-	 * @return inserted id
69
-	 */
70
-	public function getNewInsertedIdDirectories()
71
-	{
72
-		$newInsertedId = $GLOBALS['xoopsDB']->getInsertId();
73
-		return $newInsertedId;
74
-	}
66
+    /**
67
+     * The new inserted $Id
68
+     * @return inserted id
69
+     */
70
+    public function getNewInsertedIdDirectories()
71
+    {
72
+        $newInsertedId = $GLOBALS['xoopsDB']->getInsertId();
73
+        return $newInsertedId;
74
+    }
75 75
 
76
-	/**
77
-	 * @public function getForm
78
-	 * @param bool $action
79
-	 * @return \XoopsThemeForm
80
-	 */
81
-	public function getFormDirectories($action = false)
82
-	{
83
-		$helper = \XoopsModules\Wggithub\Helper::getInstance();
84
-		if (!$action) {
85
-			$action = $_SERVER['REQUEST_URI'];
86
-		}
87
-		$isAdmin = $GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid());
76
+    /**
77
+     * @public function getForm
78
+     * @param bool $action
79
+     * @return \XoopsThemeForm
80
+     */
81
+    public function getFormDirectories($action = false)
82
+    {
83
+        $helper = \XoopsModules\Wggithub\Helper::getInstance();
84
+        if (!$action) {
85
+            $action = $_SERVER['REQUEST_URI'];
86
+        }
87
+        $isAdmin = $GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid());
88 88
 
89
-		// Title
90
-		$title = $this->isNew() ? \sprintf(\_AM_WGGITHUB_DIRECTORY_ADD) : \sprintf(\_AM_WGGITHUB_DIRECTORY_EDIT);
91
-		// Get Theme Form
92
-		\xoops_load('XoopsFormLoader');
93
-		$form = new \XoopsThemeForm($title, 'form', $action, 'post', true);
94
-		$form->setExtra('enctype="multipart/form-data"');
95
-		// Form Text dirName
96
-		$form->addElement(new \XoopsFormText(\_AM_WGGITHUB_DIRECTORY_NAME, 'dir_name', 50, 255, $this->getVar('dir_name')), true);
97
-		// Directories Handler
98
-		$directoriesHandler = $helper->getHandler('Directories');
99
-		// Form Select dirType
100
-		$dirTypeSelect = new \XoopsFormSelect(\_AM_WGGITHUB_DIRECTORY_TYPE, 'dir_type', $this->getVar('dir_type'), 5);
101
-		$dirTypeSelect->addOption(Constants::DIRECTORY_TYPE_USER, \_AM_WGGITHUB_DIRECTORY_TYPE_USER);
102
-		$dirTypeSelect->addOption(Constants::DIRECTORY_TYPE_ORG, \_AM_WGGITHUB_DIRECTORY_TYPE_ORG);
103
-		$form->addElement($dirTypeSelect, true);
89
+        // Title
90
+        $title = $this->isNew() ? \sprintf(\_AM_WGGITHUB_DIRECTORY_ADD) : \sprintf(\_AM_WGGITHUB_DIRECTORY_EDIT);
91
+        // Get Theme Form
92
+        \xoops_load('XoopsFormLoader');
93
+        $form = new \XoopsThemeForm($title, 'form', $action, 'post', true);
94
+        $form->setExtra('enctype="multipart/form-data"');
95
+        // Form Text dirName
96
+        $form->addElement(new \XoopsFormText(\_AM_WGGITHUB_DIRECTORY_NAME, 'dir_name', 50, 255, $this->getVar('dir_name')), true);
97
+        // Directories Handler
98
+        $directoriesHandler = $helper->getHandler('Directories');
99
+        // Form Select dirType
100
+        $dirTypeSelect = new \XoopsFormSelect(\_AM_WGGITHUB_DIRECTORY_TYPE, 'dir_type', $this->getVar('dir_type'), 5);
101
+        $dirTypeSelect->addOption(Constants::DIRECTORY_TYPE_USER, \_AM_WGGITHUB_DIRECTORY_TYPE_USER);
102
+        $dirTypeSelect->addOption(Constants::DIRECTORY_TYPE_ORG, \_AM_WGGITHUB_DIRECTORY_TYPE_ORG);
103
+        $form->addElement($dirTypeSelect, true);
104 104
         // Form Radio Yes/No dirAutoupdate
105 105
         $dirAutoupdate = $this->isNew() ?: $this->getVar('dir_autoupdate');
106 106
         $form->addElement(new \XoopsFormRadioYN(_AM_WGGITHUB_DIRECTORY_AUTOUPDATE, 'dir_autoupdate', $dirAutoupdate));
@@ -110,51 +110,51 @@  discard block
 block discarded – undo
110 110
         // Form Radio Yes/No dirFilterrelease
111 111
         $dirFilterrelease = $this->isNew() ?: $this->getVar('dir_filterrelease');
112 112
         $form->addElement(new \XoopsFormRadioYN(_AM_WGGITHUB_DIRECTORY_FILTERRELEASE, 'dir_filterrelease', $dirFilterrelease));
113
-		// Form Text Date Select dirDatecreated
114
-		$dirDatecreated = $this->isNew() ?: $this->getVar('dir_datecreated');
115
-		$form->addElement(new \XoopsFormTextDateSelect(\_AM_WGGITHUB_DIRECTORY_DATECREATED, 'dir_datecreated', '', $dirDatecreated));
116
-		// Form Select User dirSubmitter
117
-		$form->addElement(new \XoopsFormSelectUser(\_AM_WGGITHUB_DIRECTORY_SUBMITTER, 'dir_submitter', false, $this->getVar('dir_submitter')));
118
-		// To Save
119
-		$form->addElement(new \XoopsFormHidden('op', 'save'));
120
-		$form->addElement(new \XoopsFormButtonTray('', _SUBMIT, 'submit', '', false));
121
-		return $form;
122
-	}
113
+        // Form Text Date Select dirDatecreated
114
+        $dirDatecreated = $this->isNew() ?: $this->getVar('dir_datecreated');
115
+        $form->addElement(new \XoopsFormTextDateSelect(\_AM_WGGITHUB_DIRECTORY_DATECREATED, 'dir_datecreated', '', $dirDatecreated));
116
+        // Form Select User dirSubmitter
117
+        $form->addElement(new \XoopsFormSelectUser(\_AM_WGGITHUB_DIRECTORY_SUBMITTER, 'dir_submitter', false, $this->getVar('dir_submitter')));
118
+        // To Save
119
+        $form->addElement(new \XoopsFormHidden('op', 'save'));
120
+        $form->addElement(new \XoopsFormButtonTray('', _SUBMIT, 'submit', '', false));
121
+        return $form;
122
+    }
123 123
 
124
-	/**
125
-	 * Get Values
126
-	 * @param null $keys
127
-	 * @param null $format
128
-	 * @param null $maxDepth
129
-	 * @return array
130
-	 */
131
-	public function getValuesDirectories($keys = null, $format = null, $maxDepth = null)
132
-	{
133
-		$ret = $this->getValues($keys, $format, $maxDepth);
134
-		$ret['id']          = $this->getVar('dir_id');
135
-		$ret['name']        = $this->getVar('dir_name');
136
-		$ret['type']        = $this->getVar('dir_type');
124
+    /**
125
+     * Get Values
126
+     * @param null $keys
127
+     * @param null $format
128
+     * @param null $maxDepth
129
+     * @return array
130
+     */
131
+    public function getValuesDirectories($keys = null, $format = null, $maxDepth = null)
132
+    {
133
+        $ret = $this->getValues($keys, $format, $maxDepth);
134
+        $ret['id']          = $this->getVar('dir_id');
135
+        $ret['name']        = $this->getVar('dir_name');
136
+        $ret['type']        = $this->getVar('dir_type');
137 137
         $ret['type_text']   = Constants::DIRECTORY_TYPE_USER == $this->getVar('dir_type') ? \_AM_WGGITHUB_DIRECTORY_TYPE_USER : \_AM_WGGITHUB_DIRECTORY_TYPE_ORG;
138 138
         $ret['autoupdate']  = (int)$this->getVar('dir_autoupdate') > 0 ? _YES : _NO;
139 139
         $ret['online']      = (int)$this->getVar('dir_online') > 0 ? _YES : _NO;
140 140
         $ret['filterrelease'] = (int)$this->getVar('dir_filterrelease') > 0 ? _YES : _NO;
141
-		$ret['datecreated'] = \formatTimestamp($this->getVar('dir_datecreated'), 's');
142
-		$ret['submitter']   = \XoopsUser::getUnameFromId($this->getVar('dir_submitter'));
143
-		return $ret;
144
-	}
141
+        $ret['datecreated'] = \formatTimestamp($this->getVar('dir_datecreated'), 's');
142
+        $ret['submitter']   = \XoopsUser::getUnameFromId($this->getVar('dir_submitter'));
143
+        return $ret;
144
+    }
145 145
 
146
-	/**
147
-	 * Returns an array representation of the object
148
-	 *
149
-	 * @return array
150
-	 */
151
-	public function toArrayDirectories()
152
-	{
153
-		$ret = [];
154
-		$vars = $this->getVars();
155
-		foreach (\array_keys($vars) as $var) {
156
-			$ret[$var] = $this->getVar('"{$var}"');
157
-		}
158
-		return $ret;
159
-	}
146
+    /**
147
+     * Returns an array representation of the object
148
+     *
149
+     * @return array
150
+     */
151
+    public function toArrayDirectories()
152
+    {
153
+        $ret = [];
154
+        $vars = $this->getVars();
155
+        foreach (\array_keys($vars) as $var) {
156
+            $ret[$var] = $this->getVar('"{$var}"');
157
+        }
158
+        return $ret;
159
+    }
160 160
 }
Please login to merge, or discard this patch.
class/Constants.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  */
29 29
 interface Constants
30 30
 {
31
-	// Constants for tables
31
+    // Constants for tables
32 32
     public const TABLE_SETTINGS = 0;
33 33
     public const TABLE_REPOSITORIES = 1;
34 34
     public const TABLE_DIRECTORIES = 2;
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
     public const DIRECTORY_TYPE_USER = 1;
40 40
     public const DIRECTORY_TYPE_ORG  = 2;
41 41
 
42
-	// Constants for status
43
-	public const STATUS_NONE     = 0;
42
+    // Constants for status
43
+    public const STATUS_NONE     = 0;
44 44
     public const STATUS_NEW      = 1;
45 45
     public const STATUS_UPDATED  = 2;
46
-	public const STATUS_UPTODATE = 3;
46
+    public const STATUS_UPTODATE = 3;
47 47
 
48
-	// Constants for permissions
49
-	public const PERM_GLOBAL_NONE   = 0;
50
-	public const PERM_GLOBAL_VIEW   = 1;
51
-	public const PERM_GLOBAL_READ   = 2;
52
-	public const PERM_README_UPDATE = 3;
48
+    // Constants for permissions
49
+    public const PERM_GLOBAL_NONE   = 0;
50
+    public const PERM_GLOBAL_VIEW   = 1;
51
+    public const PERM_GLOBAL_READ   = 2;
52
+    public const PERM_README_UPDATE = 3;
53 53
 
54 54
 }
Please login to merge, or discard this patch.
class/ReadmesHandler.php 1 patch
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -35,96 +35,96 @@
 block discarded – undo
35 35
  */
36 36
 class ReadmesHandler extends \XoopsPersistableObjectHandler
37 37
 {
38
-	/**
39
-	 * Constructor
40
-	 *
41
-	 * @param \XoopsDatabase $db
42
-	 */
43
-	public function __construct(\XoopsDatabase $db)
44
-	{
45
-		parent::__construct($db, 'wggithub_readmes', Readmes::class, 'rm_id', 'rm_name');
46
-	}
38
+    /**
39
+     * Constructor
40
+     *
41
+     * @param \XoopsDatabase $db
42
+     */
43
+    public function __construct(\XoopsDatabase $db)
44
+    {
45
+        parent::__construct($db, 'wggithub_readmes', Readmes::class, 'rm_id', 'rm_name');
46
+    }
47 47
 
48
-	/**
49
-	 * @param bool $isNew
50
-	 *
51
-	 * @return object
52
-	 */
53
-	public function create($isNew = true)
54
-	{
55
-		return parent::create($isNew);
56
-	}
48
+    /**
49
+     * @param bool $isNew
50
+     *
51
+     * @return object
52
+     */
53
+    public function create($isNew = true)
54
+    {
55
+        return parent::create($isNew);
56
+    }
57 57
 
58
-	/**
59
-	 * retrieve a field
60
-	 *
61
-	 * @param int $i field id
62
-	 * @param null fields
63
-	 * @return mixed reference to the {@link Get} object
64
-	 */
65
-	public function get($i = null, $fields = null)
66
-	{
67
-		return parent::get($i, $fields);
68
-	}
58
+    /**
59
+     * retrieve a field
60
+     *
61
+     * @param int $i field id
62
+     * @param null fields
63
+     * @return mixed reference to the {@link Get} object
64
+     */
65
+    public function get($i = null, $fields = null)
66
+    {
67
+        return parent::get($i, $fields);
68
+    }
69 69
 
70
-	/**
71
-	 * get inserted id
72
-	 *
73
-	 * @param null
74
-	 * @return int reference to the {@link Get} object
75
-	 */
76
-	public function getInsertId()
77
-	{
78
-		return $this->db->getInsertId();
79
-	}
70
+    /**
71
+     * get inserted id
72
+     *
73
+     * @param null
74
+     * @return int reference to the {@link Get} object
75
+     */
76
+    public function getInsertId()
77
+    {
78
+        return $this->db->getInsertId();
79
+    }
80 80
 
81
-	/**
82
-	 * Get Count Readmes in the database
83
-	 * @param int    $start
84
-	 * @param int    $limit
85
-	 * @param string $sort
86
-	 * @param string $order
87
-	 * @return int
88
-	 */
89
-	public function getCountReadmes($start = 0, $limit = 0, $sort = 'rm_id ASC, rm_name', $order = 'ASC')
90
-	{
91
-		$crCountReadmes = new \CriteriaCompo();
92
-		$crCountReadmes = $this->getReadmesCriteria($crCountReadmes, $start, $limit, $sort, $order);
93
-		return $this->getCount($crCountReadmes);
94
-	}
81
+    /**
82
+     * Get Count Readmes in the database
83
+     * @param int    $start
84
+     * @param int    $limit
85
+     * @param string $sort
86
+     * @param string $order
87
+     * @return int
88
+     */
89
+    public function getCountReadmes($start = 0, $limit = 0, $sort = 'rm_id ASC, rm_name', $order = 'ASC')
90
+    {
91
+        $crCountReadmes = new \CriteriaCompo();
92
+        $crCountReadmes = $this->getReadmesCriteria($crCountReadmes, $start, $limit, $sort, $order);
93
+        return $this->getCount($crCountReadmes);
94
+    }
95 95
 
96
-	/**
97
-	 * Get All Readmes in the database
98
-	 * @param int    $start
99
-	 * @param int    $limit
100
-	 * @param string $sort
101
-	 * @param string $order
102
-	 * @return array
103
-	 */
104
-	public function getAllReadmes($start = 0, $limit = 0, $sort = 'rm_id ASC, rm_name', $order = 'ASC')
105
-	{
106
-		$crAllReadmes = new \CriteriaCompo();
107
-		$crAllReadmes = $this->getReadmesCriteria($crAllReadmes, $start, $limit, $sort, $order);
108
-		return $this->getAll($crAllReadmes);
109
-	}
96
+    /**
97
+     * Get All Readmes in the database
98
+     * @param int    $start
99
+     * @param int    $limit
100
+     * @param string $sort
101
+     * @param string $order
102
+     * @return array
103
+     */
104
+    public function getAllReadmes($start = 0, $limit = 0, $sort = 'rm_id ASC, rm_name', $order = 'ASC')
105
+    {
106
+        $crAllReadmes = new \CriteriaCompo();
107
+        $crAllReadmes = $this->getReadmesCriteria($crAllReadmes, $start, $limit, $sort, $order);
108
+        return $this->getAll($crAllReadmes);
109
+    }
110 110
 
111
-	/**
112
-	 * Get Criteria Readmes
113
-	 * @param        $crReadmes
114
-	 * @param int    $start
115
-	 * @param int    $limit
116
-	 * @param string $sort
117
-	 * @param string $order
118
-	 * @return int
119
-	 */
120
-	private function getReadmesCriteria($crReadmes, $start, $limit, $sort, $order)
121
-	{
122
-		$crReadmes->setStart($start);
123
-		$crReadmes->setLimit($limit);
124
-		$crReadmes->setSort($sort);
125
-		$crReadmes->setOrder($order);
126
-		return $crReadmes;
127
-	}
111
+    /**
112
+     * Get Criteria Readmes
113
+     * @param        $crReadmes
114
+     * @param int    $start
115
+     * @param int    $limit
116
+     * @param string $sort
117
+     * @param string $order
118
+     * @return int
119
+     */
120
+    private function getReadmesCriteria($crReadmes, $start, $limit, $sort, $order)
121
+    {
122
+        $crReadmes->setStart($start);
123
+        $crReadmes->setLimit($limit);
124
+        $crReadmes->setSort($sort);
125
+        $crReadmes->setOrder($order);
126
+        return $crReadmes;
127
+    }
128 128
 
129 129
     /**
130 130
      * Update table requests
Please login to merge, or discard this patch.