Skip to content

Commit 53ea587

Browse files
committed
1.03 Beta 2
1 parent 3c943ff commit 53ea587

File tree

17 files changed

+218
-178
lines changed

17 files changed

+218
-178
lines changed

admin/admin_footer.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@
1414
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
1515
* @package
1616
* @since
17-
* @author XOOPS Development Team
18-
* @version $Id $
17+
* @author XOOPS Development Team
18+
* @version $Id $
1919
*/
2020

2121
global $xoopsModule;
22-
$pathIcon32 = XOOPS_URL .'/' . $xoopsModule->getInfo('sysIcons32');
22+
$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('sysIcons32');
2323

24-
echo "<div class='adminfooter'>\n"
25-
." <div style='text-align: center;'>\n"
26-
." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
27-
." </div>\n"
28-
.' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
29-
.'</div>';
24+
echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';
3025

3126
xoops_cp_footer();

class/category.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct()
6666

6767
/**
6868
* @param string $method
69-
* @param array $args
69+
* @param array $args
7070
*
7171
* @return mixed
7272
*/
@@ -379,7 +379,9 @@ public function __construct(XoopsDatabase $db)
379379
*
380380
* @param int $id itemid of the user
381381
*
382-
* @return mixed reference to the {@link PublisherCategory} object, FALSE if failed
382+
* @param null $fields
383+
* @return mixed reference to the <a href='psi_element://PublisherCategory'>PublisherCategory</a> object, FALSE if failed
384+
* object, FALSE if failed
383385
*/
384386
public function get($id = null, $fields = null)
385387
{
@@ -396,9 +398,8 @@ public function get($id = null, $fields = null)
396398
/**
397399
* insert a new category in the database
398400
*
399-
* @param object $category reference to the {@link PublisherCategory} object
400-
* @param bool $force
401-
*
401+
* @param object|XoopsObject $category reference to the {@link PublisherCategory}
402+
* @param bool $force
402403
* @return bool FALSE if failed, TRUE if already present and unchanged or successful
403404
*/
404405
public function insert(XoopsObject $category, $force = false) //insert(&$category, $force = false)
@@ -426,7 +427,7 @@ public function insert(XoopsObject $category, $force = false) //insert(&$categor
426427
* delete a category from the database
427428
*
428429
* @param XoopsObject $category reference to the category to delete
429-
* @param bool $force
430+
* @param bool $force
430431
*
431432
* @return bool FALSE if failed.
432433
*/
@@ -458,14 +459,15 @@ public function delete(XoopsObject $category, $force = false) //delete(&$categor
458459
* retrieve categories from the database
459460
*
460461
* @param CriteriaElement $criteria {@link CriteriaElement} conditions to be met
461-
* @param bool $idAsKey use the categoryid as key for the array?
462+
* @param bool $idAsKey use the categoryid as key for the array?
462463
*
463-
* @return array array of {@link XoopsItem} objects
464+
* @param bool $as_object
465+
* @return array array of <a href='psi_element://XoopsItem'>XoopsItem</a> objects
464466
*/
465467
public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false, $as_object = true) //&getObjects($criteria = null, $idAsKey = false)
466468
{
467469
$ret = array();
468-
$theObjects = parent::getObjects($criteria, true);
470+
$theObjects =& parent::getObjects($criteria, true);
469471
foreach ($theObjects as $theObject) {
470472
if (!$idAsKey) {
471473
$ret[] = $theObject;
@@ -479,12 +481,12 @@ public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false,
479481
}
480482

481483
/**
482-
* @param int $limit
483-
* @param int $start
484-
* @param int $parentid
484+
* @param int $limit
485+
* @param int $start
486+
* @param int $parentid
485487
* @param string $sort
486488
* @param string $order
487-
* @param bool $idAsKey
489+
* @param bool $idAsKey
488490
*
489491
* @return array
490492
*/
@@ -690,11 +692,13 @@ public function getSubCats($categories)
690692
*
691693
* @param CriteriaElement $criteria {@link CriteriaElement}
692694
*
695+
* @param bool $force
696+
* @param bool $asObject
693697
* @return bool FALSE if deletion failed
694698
*/
695699
public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) //deleteAll($criteria = null)
696700
{
697-
$categories = $this->getObjects($criteria);
701+
$categories =& $this->getObjects($criteria);
698702
foreach ($categories as $category) {
699703
if (!$this->delete($category)) {
700704
return false;
@@ -715,7 +719,7 @@ public function publishedItemsCount($catId = 0)
715719
}
716720

717721
/**
718-
* @param int $catId
722+
* @param int $catId
719723
* @param string $status
720724
*
721725
* @return mixed

class/file.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct($id = null)
6565

6666
/**
6767
* @param string $method
68-
* @param array $args
68+
* @param array $args
6969
*
7070
* @return mixed
7171
*/
@@ -78,8 +78,8 @@ public function __call($method, $args)
7878

7979
/**
8080
* @param string $postField
81-
* @param array $allowedMimetypes
82-
* @param array $errors
81+
* @param array $allowedMimetypes
82+
* @param array $errors
8383
*
8484
* @return bool
8585
*/
@@ -110,8 +110,8 @@ public function checkUpload($postField, $allowedMimetypes = array(), &$errors)
110110

111111
/**
112112
* @param string $postField
113-
* @param array $allowedMimetypes
114-
* @param array $errors
113+
* @param array $allowedMimetypes
114+
* @param array $errors
115115
*
116116
* @return bool
117117
*/
@@ -153,16 +153,16 @@ public function storeUpload($postField, $allowedMimetypes = array(), &$errors)
153153

154154
/**
155155
* @param null|array $allowedMimetypes
156-
* @param bool $force
157-
* @param bool $doupload
156+
* @param bool $force
157+
* @param bool $doupload
158158
*
159159
* @return bool
160160
*/
161161
public function store($allowedMimetypes = null, $force = true, $doupload = true)
162162
{
163163
if ($this->isNew()) {
164164
$errors = array();
165-
$ret = true;
165+
$ret = true;
166166
if ($doupload) {
167167
$ret = $this->storeUpload('item_upload_file', $allowedMimetypes, $errors);
168168
}
@@ -302,12 +302,12 @@ public function __construct(XoopsDatabase $db)
302302
/**
303303
* delete a file from the database
304304
*
305-
* @param object $file reference to the file to delete
306-
* @param bool $force
305+
* @param XoopsObject $file reference to the file to delete
306+
* @param bool $force
307307
*
308308
* @return bool FALSE if failed.
309309
*/
310-
public function delete(&$file, $force = false)
310+
public function delete(XoopsObject $file, $force = false) //delete(&$file, $force = false)
311311
{
312312
$ret = false;
313313
// Delete the actual file
@@ -330,7 +330,7 @@ public function deleteItemFiles(&$itemObj)
330330
if (strtolower(get_class($itemObj)) !== 'publisheritem') {
331331
return false;
332332
}
333-
$files =& $this->getAllFiles($itemObj->itemid());
333+
$files = $this->getAllFiles($itemObj->itemid());
334334
$result = true;
335335
foreach ($files as $file) {
336336
if (!$this->delete($file)) {
@@ -344,17 +344,17 @@ public function deleteItemFiles(&$itemObj)
344344
/**
345345
* retrieve all files
346346
*
347-
* @param int $itemid
348-
* @param int $status
349-
* @param int $limit
350-
* @param int $start
347+
* @param int $itemid
348+
* @param int $status
349+
* @param int $limit
350+
* @param int $start
351351
* @param string $sort
352352
* @param string $order
353-
* @param array $category
353+
* @param array $category
354354
*
355355
* @return array array of {@link PublisherFile} objects
356356
*/
357-
public function &getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = array())
357+
public function getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = array())
358358
{
359359
global $xoopsDB;
360360
$files = array();

class/form/category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function createElements()
8484

8585
// EDITOR
8686
$groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
87-
$gpermHandler =& $this->publisher->getHandler('groupperm');
87+
$gpermHandler = $this->publisher->getHandler('groupperm');
8888
$moduleId = $this->publisher->getModule()->mid();
8989
$allowedEditors = publisherGetEditors($gpermHandler->getItemIds('editors', $groups, $moduleId));
9090
$nohtml = false;

class/form/item.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function createElements($obj)
163163
// TAGS
164164
if (xoops_isActiveModule('tag') && $this->isGranted(PublisherConstants::PUBLISHER_ITEM_TAG)) {
165165
include_once $GLOBALS['xoops']->path('modules/tag/include/formtag.php');
166-
$textTags = new XoopsFormTag('item_tag', 60, 255, $obj->getVar('item_tag', 'e'), 0);
166+
$textTags = new TagFormTag('item_tag', 60, 255, $obj->getVar('item_tag', 'e'), 0);
167167
$this->addElement($textTags);
168168
}
169169

@@ -285,9 +285,9 @@ public function createElements($obj)
285285
// STATUS
286286
if ($this->isGranted(PublisherConstants::PUBLISHER_STATUS)) {
287287
$options = array(
288+
PublisherConstants::PUBLISHER_STATUS_SUBMITTED => _CO_PUBLISHER_SUBMITTED,
288289
PublisherConstants::PUBLISHER_STATUS_PUBLISHED => _CO_PUBLISHER_PUBLISHED,
289290
PublisherConstants::PUBLISHER_STATUS_OFFLINE => _CO_PUBLISHER_OFFLINE,
290-
PublisherConstants::PUBLISHER_STATUS_SUBMITTED => _CO_PUBLISHER_SUBMITTED,
291291
PublisherConstants::PUBLISHER_STATUS_REJECTED => _CO_PUBLISHER_REJECTED);
292292
$statusSelect = new XoopsFormSelect(_CO_PUBLISHER_STATUS, 'status', $obj->getVar('status'));
293293
$statusSelect->addOptionArray($options);
@@ -515,8 +515,8 @@ public function createElements($obj)
515515
$table .= '</tr>';
516516

517517
foreach ($filesObj as $fileObj) {
518-
$modify = "<a href='file.php?op=mod&fileid=" . $fileObj->fileid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/edit.gif' title='" . _CO_PUBLISHER_EDITFILE . "' alt='" . _CO_PUBLISHER_EDITFILE . "' /></a>";
519-
$delete = "<a href='file.php?op=del&fileid=" . $fileObj->fileid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/delete.png' title='" . _CO_PUBLISHER_DELETEFILE . "' alt='" . _CO_PUBLISHER_DELETEFILE . "'/></a>";
518+
$modify = "<a href='file.php?op=mod&fileid=" . $fileObj->fileid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/edit.gif' title='" . _CO_PUBLISHER_EDITFILE . "' alt='" . _CO_PUBLISHER_EDITFILE . "' /></a>";
519+
$delete = "<a href='file.php?op=del&fileid=" . $fileObj->fileid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/delete.png' title='" . _CO_PUBLISHER_DELETEFILE . "' alt='" . _CO_PUBLISHER_DELETEFILE . "'/></a>";
520520
$not_visible = '';
521521
if ($fileObj->status() == 0) {
522522
$not_visible = "<img src='" . PUBLISHER_URL . "/assets/images/no.gif'/>";

class/groupperm.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ class PublisherGroupPermHandler extends XoopsGroupPermHandler
3434
/**
3535
* Check permission
3636
*
37-
* @param string $gpermName Name of permission
38-
* @param int $gpermItemId ID of an item
39-
* @param int /array $gpermGroupId A group ID or an array of group IDs
40-
* @param int $gpermModId ID of a module
37+
* @param string $gpermName Name of permission
38+
* @param int $gpermItemId ID of an item
39+
* @param $gpermGroupId
40+
* @param int $gpermModId ID of a module
4141
*
42+
* @param bool $trueifadmin
4243
* @return bool TRUE if permission is enabled
44+
* @internal param $int /array $gpermGroupId A group ID or an array of group IDs
4345
*/
44-
public function checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1)
46+
public function checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1, $trueifadmin = true) //checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1)
4547
{
4648
$criteria = new CriteriaCompo(new Criteria('gperm_modid', $gpermModId));
4749
$criteria->add(new Criteria('gperm_name', $gpermName));

0 commit comments

Comments
 (0)