Alex Trofimov %!s(int64=7) %!d(string=hai) anos
pai
achega
2062013ac7

+ 2 - 2
inc/classes/BxDolService.php

@@ -110,7 +110,7 @@ class BxDolService extends BxDol
         $aModule = self::getModule($a[0]);
         if (empty($aModule))
             return _t('_sys_macros_method_or_class_not_found');
-        $iCheck = BxDolRequest::checkCall($aModule, $a[1], $aParams, isset($a[3]) ? $a[3] : 'Module');
+        $iCheck = BxDolRequest::checkCall($aModule, $a[1], $aParams, isset($a[2]) ? $a[2] : 'Module');
         switch ($iCheck) {
             case 1: 
                 return _t('_sys_macros_method_or_class_not_found');
@@ -121,7 +121,7 @@ class BxDolService extends BxDol
         }
 
         // perform call
-        $mixed = self::call($a[0], $a[1], $aParams, isset($a[3]) ? $a[3] : 'Module', isset($a[4]) && 'ignore_cache' == $a[4] ? true : false);
+        $mixed = self::call($a[0], $a[1], $aParams, isset($a[2]) ? $a[2] : 'Module', isset($a[3]) && 'ignore_cache' == $a[3] ? true : false);
 
         // check result
         if (is_object($mixed))

+ 18 - 4
template/scripts/BxBaseServiceAccount.php

@@ -31,20 +31,20 @@ class BxBaseServiceAccount extends BxDol
      * @subsubsection bx_system_general-create_account_form create_account_form
      * 
      * @code bx_srv('system', 'create_account_form', [], 'TemplServiceAccount'); @endcode
-     * @code {{~system:create_account_form:TemplServiceAccount~}} @endcode
+     * @code {{~system:create_account_form:TemplServiceAccount[{"no_login_text":true, "no_auth_buttons":true}]~}} @endcode
      * 
      * Join form.
      * @param $aParams array of additional params, such as: 
      *          - no_login_text
      *          - no_auth_buttons
      * 
-     * @see BxBaseServices::serviceGetCreatePostForm
+     * @see BxBaseServiceAccount::serviceGetCreatePostForm
      */
     /** 
      * @ref bx_system_general-create_account_form "create_account_form"
      */
     public function serviceCreateAccountForm ($aParams = array())
-    {   
+    {
         if(isLogged()){
             header('Location: ' . BX_DOL_URL_ROOT);
             exit;
@@ -328,7 +328,21 @@ class BxBaseServiceAccount extends BxDol
     }
 
     /**
-     * Display forgot password form, if reset password key is provided then reset password
+     * @page service Service Calls
+     * @section bx_system_general System Services 
+     * @subsection bx_system_general-account Account
+     * @subsubsection bx_system_general-forgot_password forgot_password
+     * 
+     * @code bx_srv('system', 'forgot_password', [], 'TemplServiceAccount'); @endcode
+     * @code {{~system:forgot_password:TemplServiceAccount~}} @endcode
+     * 
+     * Display forgot password form, 
+     * if reset password key is provided then reset password
+     * 
+     * @see BxBaseServiceAccount::serviceForgotPassword
+     */
+    /** 
+     * @ref bx_system_general-forgot_password "forgot_password"
      */
     public function serviceForgotPassword()
     {

+ 23 - 2
template/scripts/BxBaseServiceCategory.php

@@ -12,15 +12,36 @@
  */
 class BxBaseServiceCategory extends BxDol
 {
+
     /**
-     * Get categories list
+     * @page service Service Calls
+     * @section bx_system_general System Services 
+     * @subsection bx_system_general-categories Categories
+     * @subsubsection bx_system_general-categories_list categories_list
+     * 
+     * @code bx_srv('system', 'categories_list', ["bx_posts_cats", ["show_empty_categories" => true]], 'TemplServiceCategory'); @endcode
+     * @code {{~system:categories_list:TemplServiceCategory["bx_posts_cats", {"show_empty_categories":true}]~}} @endcode
+     * 
+     * Get categories list.
+     * @param $sObject categories object name
+     * @param $aParams additional params:
+     *              - show_empty
+     *              - show_empty_categories
+     * 
+     * @see BxBaseServiceCategory::serviceCategoriesList
+     */
+    /** 
+     * @ref bx_system_general-categories_list "categories_list"
      */
     public function serviceCategoriesList ($sObject, $aParams = array())
     {
     	$bShowEmpty = isset($aParams['show_empty']) ? (bool)$aParams['show_empty'] : false;
     	$bShowEmptyCategories = isset($aParams['show_empty_categories']) ? (bool)$aParams['show_empty_categories'] : false;
 
-		$sResult = BxDolCategory::getObjectInstance($sObject)->getCategoriesList($bShowEmptyCategories);
+        if (!($o = BxDolCategory::getObjectInstance($sObject)))
+            return $bShowEmpty ? MsgBox(_t('_Empty')) : '';
+
+		$sResult = $o->getCategoriesList($bShowEmptyCategories);
 		if(empty($sResult))
 			return $bShowEmpty ? MsgBox(_t('_Empty')) : '';
 

+ 3 - 0
template/scripts/BxBaseServices.php

@@ -31,6 +31,9 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
             'KeywordSearch' => 'BxBaseServices',
 
             'CreateAccountForm' => 'BxBaseServiceAccount',
+            'ForgotPassword' => 'BxBaseServiceAccount',
+
+            'CategoriesList' => 'BxBaseServiceCategory',
         );
     }
     public function serviceProfileUnit ($iContentId, $aParams = array())