Bläddra i källkod

#53 - Check TODOs in the code: Studio.

AntonLV 12 år sedan
förälder
incheckning
ee76f98877

+ 2 - 2
modules/boonex/convos/install/config.php

@@ -56,14 +56,14 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 3 - 29
modules/boonex/developer/install/config.php

@@ -38,44 +38,18 @@ $aConfig = array(
      * Installation/Uninstallation Section.
      */
     'install' => array(
-        'show_introduction' => 0,
-        'change_permissions' => 0,
         'execute_sql' => 1,
         'update_languages' => 1,
         'recompile_global_paramaters' => 1,
-        'recompile_main_menu' => 0,
-        'recompile_member_menu' => 0,
-        'recompile_site_stats' => 0,
-        'recompile_page_builder' => 1,
-        'recompile_profile_fields' => 0,
-        'recompile_comments' => 0,
-        'recompile_member_actions' => 0,
-        'recompile_votes' => 0,
-        'recompile_injections' => 0,
         'recompile_permalinks' => 1,
-        'recompile_alerts' => 0,
-        'clear_db_cache' => 1,
-        'show_conclusion' => 0
+        'clear_db_cache' => 1
     ),
     'uninstall' => array (
-        'show_introduction' => 0,
-        'change_permissions' => 0,
         'execute_sql' => 1,
         'update_languages' => 1,
         'recompile_global_paramaters' => 1,
-        'recompile_main_menu' => 0,
-        'recompile_member_menu' => 0,
-        'recompile_site_stats' => 0,
-        'recompile_page_builder' => 0,
-        'recompile_profile_fields' => 0,
-        'recompile_comments' => 0,
-        'recompile_member_actions' => 0,
-        'recompile_votes' => 0,
-        'recompile_injections' => 0,
-        'recompile_permalinks' => 0,
-        'recompile_alerts' => 0,
-        'clear_db_cache' => 1,
-        'show_conclusion' => 0
+        'recompile_permalinks' => 1,
+        'clear_db_cache' => 1
     ),
     'enable' => array(
         'execute_sql' => 1,

+ 1 - 4
modules/boonex/english/data/langs/system.xml

@@ -1231,13 +1231,10 @@
 	<string name="_adm_txt_modules_recompile_comments"><![CDATA[Recompiling comments:]]></string>
 	<string name="_adm_txt_modules_recompile_global_paramaters"><![CDATA[Recompiling global paramaters:]]></string>
 	<string name="_adm_txt_modules_recompile_injections"><![CDATA[Recompiling injections:]]></string>
-	<string name="_adm_txt_modules_recompile_main_menu"><![CDATA[Recompiling main menu:]]></string>
+	<string name="_adm_txt_modules_recompile_menus"><![CDATA[Recompiling menus:]]></string>
 	<string name="_adm_txt_modules_recompile_member_actions"><![CDATA[Recompiling member actions:]]></string>
-	<string name="_adm_txt_modules_recompile_member_menu"><![CDATA[Recompiling member menu:]]></string>
 	<string name="_adm_txt_modules_recompile_member_stats"><![CDATA[Recompiling member statistics:]]></string>
-	<string name="_adm_txt_modules_recompile_page_builder"><![CDATA[Recompiling page builder:]]></string>
 	<string name="_adm_txt_modules_recompile_permalinks"><![CDATA[Recompiling permalinks:]]></string>
-	<string name="_adm_txt_modules_recompile_profile_fields"><![CDATA[Recompiling profile fields:]]></string>
 	<string name="_adm_txt_modules_recompile_search"><![CDATA[Recompiling search:]]></string>
 	<string name="_adm_txt_modules_recompile_site_stats"><![CDATA[Recompiling site statistics:]]></string>
 	<string name="_adm_txt_modules_recompile_votes"><![CDATA[Recompiling votes:]]></string>

+ 2 - 2
modules/boonex/notes/install/config.php

@@ -56,14 +56,14 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 2 - 2
modules/boonex/organizations/install/config.php

@@ -56,14 +56,14 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 2 - 2
modules/boonex/persons/install/config.php

@@ -56,14 +56,14 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 1 - 4
modules/boonex/russian/data/langs/system.xml

@@ -2444,12 +2444,9 @@ Without doing that you won't be submitted to our database.</p>
 	<string name="_adm_txt_modules_install_language"><![CDATA[Install language:]]></string>
 	<string name="_adm_txt_modules_update_languages"><![CDATA[Update languages:]]></string>
 	<string name="_adm_txt_modules_recompile_global_paramaters"><![CDATA[Recompiling global paramaters:]]></string>
-	<string name="_adm_txt_modules_recompile_main_menu"><![CDATA[Recompiling main menu:]]></string>
-	<string name="_adm_txt_modules_recompile_member_menu"><![CDATA[Recompiling member menu:]]></string>
+	<string name="_adm_txt_modules_recompile_menus"><![CDATA[Recompiling menus:]]></string>
 	<string name="_adm_txt_modules_recompile_site_stats"><![CDATA[Recompiling site statistics:]]></string>
 	<string name="_adm_txt_modules_recompile_member_stats"><![CDATA[Recompiling member statistics:]]></string>
-	<string name="_adm_txt_modules_recompile_page_builder"><![CDATA[Recompiling page builder:]]></string>
-	<string name="_adm_txt_modules_recompile_profile_fields"><![CDATA[Recompiling profile fields:]]></string>
 	<string name="_adm_txt_modules_recompile_comments"><![CDATA[Recompiling comments:]]></string>
 	<string name="_adm_txt_modules_recompile_member_actions"><![CDATA[Recompiling member actions:]]></string>
 	<string name="_adm_txt_modules_recompile_votes"><![CDATA[Recompiling votes:]]></string>

+ 4 - 2
modules/boonex/sites/install/config.php

@@ -56,14 +56,16 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+    	'recompile_global_paramaters' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 1,
+	    'recompile_global_paramaters' => 1,
+        'recompile_menus' => 1,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 0 - 2
modules/boonex/timeline/install/config.php

@@ -54,14 +54,12 @@ $aConfig = array(
     ),
     'enable' => array(
         'execute_sql' => 1,
-        'recompile_main_menu' => 0,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,
     ),
     'disable' => array (
         'execute_sql' => 1,
-        'recompile_main_menu' => 0,
         'recompile_permalinks' => 1,
         'recompile_alerts' => 1,
         'clear_db_cache' => 1,

+ 2 - 10
modules/boonex/uni/install/config.php

@@ -44,22 +44,14 @@ $aConfig = array(
      * Installation/Uninstallation Section.
      */
     'install' => array(
-        'show_introduction' => 0,
-        'change_permissions' => 0,
         'execute_sql' => 1,
         'update_languages' => 1,
-        'recompile_global_paramaters' => 1,
-        'clear_db_cache' => 0,
-        'show_conclusion' => 0
+        'recompile_global_paramaters' => 1
     ),
     'uninstall' => array (
-        'show_introduction' => 0,
-        'change_permissions' => 0,
         'execute_sql' => 1,
         'update_languages' => 1,
-        'recompile_global_paramaters' => 1,
-        'clear_db_cache' => 0,
-        'show_conclusion' => 0
+        'recompile_global_paramaters' => 1
     ),
     'enable' => array(
         'execute_sql' => 1

+ 3 - 57
studio/classes/BxDolStudioInstaller.php

@@ -690,60 +690,14 @@ class BxDolStudioInstaller extends BxDolInstallerUtils {
         $bResult = $this->oDb->cacheParamsClear();
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
     }
-    function actionRecompileMainMenu($sOperation) {
-        /*
-        TODO: Update the code when menu engine is rewrited.
-    	bx_import('BxDolMenu');
-        $bResult = BxDolMenu::getInstance()->_compile();
-		*/
-
-        $bResult = true;
-        return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
-    }
-    function actionRecompileMemberMenu($sOperation) {
-        /*
-        //TODO: Recreate if the feature will be available.
-        bx_import('BxDolMemberMenu');
-        $oMemberMenu = new BxDolMemberMenu();
-
-        $bResult = $oMemberMenu->deleteMemberMenuCaches();
-        */
-
-        $bResult = true;
+    function actionRecompileMenus($sOperation) {
+        $bResult = $this->oDb->cleanCache('sys_objects_menu');
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
     }
     function actionRecompileSiteStats($sOperation) {
         $bResult = $this->oDb->cleanCache('sys_stat_site');
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
     }
-    function actionRecompilePageBuilder($sOperation) {
-        /*
-		//TODO: Recreate when cache engine is available. 
-    	bx_import('BxDolPageViewCacher');
-
-        ob_start();
-        $oPVCacher = new BxDolPageViewCacher('sys_page_compose', 'sys_page_compose.inc');
-        $bResult = $oPVCacher->createCache();
-        ob_get_clean();
-        */
-
-        $bResult = true;
-        return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
-    }
-    function actionRecompileProfileFields($sOperation) {
-        /*
-		//TODO: Recreate when cache engine is available. 
-    	bx_import('BxDolPFMCacher');
-
-        ob_start();
-        $oBxDolPFMCacher = new BxDolPFMCacher();
-        $bResult = $oBxDolPFMCacher -> createCache();
-        ob_get_clean();
-		*/
-
-        $bResult = true;
-        return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
-    }
     function actionRecompileComments($sOperation) {        
         $bResult = $this->oDb->cleanCache('sys_objects_cmts');
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
@@ -765,18 +719,10 @@ class BxDolStudioInstaller extends BxDolInstallerUtils {
     function actionRecompilePermalinks($sOperation) {
         $bResult = true;
 
-        ob_start();
         bx_import('BxDolPermalinks');
         $bResult = $bResult && BxDolPermalinks::getInstance()->cacheInvalidate();
 
-        /*
-        TODO: Update the code when menu engine is rewrited. 
-        bx_import('BxDolMenu');
-        $bResult = $bResult && BxDolMenu::getInstance()->_compile();
-		*/
-
-        $bResult = $bResult && $this->oDb->cleanCache('sys_menu_member');
-        ob_get_clean();
+        $bResult = $bResult && ($this->actionRecompileMenus($sOperation) == BX_DOL_STUDIO_INSTALLER_SUCCESS);
 
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
     }

+ 1 - 3
studio/classes/BxDolStudioOAuth.php

@@ -113,7 +113,7 @@ class BxDolStudioOAuth extends BxDol implements iBxDolSingleton {
 			    	return $this->processServerError($aRequestToken);
 
 			    $this->oSession->setValue('sys_oauth_secret', $aRequestToken['oauth_token_secret']);
-			    return _t('_adm_msg_oauth_need_authorize', bx_append_url_params(BX_DOL_OAUTH_URL_AUTHORIZE, array('oauth_token' => $aRequestToken['oauth_token'], 'sid' => generateSid())));
+			    return _t('_adm_msg_oauth_need_authorize', bx_append_url_params(BX_DOL_OAUTH_URL_AUTHORIZE, array('oauth_token' => $aRequestToken['oauth_token'], 'sid' => bx_site_hash())));
 			}
 
 			//--- Get access token. 
@@ -135,7 +135,6 @@ class BxDolStudioOAuth extends BxDol implements iBxDolSingleton {
 			}
 		}
 		catch(OAuthException $e) {
-			//TODO: Write in LOG print_r($e)
 			return _t('_adm_err_oauth_cannot_get_token');
 		}
     }
@@ -157,7 +156,6 @@ class BxDolStudioOAuth extends BxDol implements iBxDolSingleton {
 			return json_decode($oConsumer->getLastResponse(), true);
 		}
     	catch(OAuthException $e) {
-    		//TODO: Write in LOG print_r($e);
 			return array();
 		}
     }

+ 1 - 1
studio/classes/BxDolStudioStore.php

@@ -374,7 +374,7 @@ class BxDolStudioStore extends BxTemplStudioPage {
 		foreach($aItems as $aItem)
 			$aIds[] = $aItem['item_id'];
 
-		$sSid = generateSid();
+		$sSid = bx_site_hash();
 		return BX_DOL_UNITY_URL_MARKET . 'purchase/' . $sVendor . '?sid=' . $sSid . '&products=' . base64_encode(implode(',', $aIds));
     }
 

+ 0 - 8
studio/inc/utils.inc.php

@@ -5,14 +5,6 @@
  * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
  */
 
-/*
- * Returns unique SID for communication with BoonEx Unity.
- * @see BxDolStudioStore  -> checkoutCart and BxDolStudioOAuth -> authorize
- */
-function generateSid() {
-	return md5(BX_DOL_URL_ROOT . '_' . getParam('sys_version')); // TODO: maybe change to bx_site_hash() ?
-}
-
 function bx_array_insert_before($aInsert, $aSource, $sKey) {
 	return bx_array_insert($aInsert, $aSource, $sKey, 0);
 }