Created
June 14, 2013 15:01
-
-
Save dpobel/5782559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/bin/shell/common.sh b/bin/shell/common.sh | |
| index 57149b8..f5330ef 100755 | |
| --- a/bin/shell/common.sh | |
| +++ b/bin/shell/common.sh | |
| @@ -1,13 +1,13 @@ | |
| #!/bin/bash | |
| -VERSION="5.1.0alpha1" | |
| +VERSION="5.2.0alpha1" | |
| VERSION_RELEASE="0" | |
| -VERSION_ONLY="5.1" | |
| +VERSION_ONLY="5.2" | |
| VERSION_STATE="alpha1" | |
| -VERSION_PREVIOUS="5.0.0" | |
| +VERSION_PREVIOUS="5.1.0" | |
| VERSION_BRANCH="$VERSION_ONLY" | |
| VERSION_NICK="$VERSION" | |
| -VERSION_STABLE="5.0.0" | |
| +VERSION_STABLE="5.1.0" | |
| DEVELOPMENT="true" | |
| DEVELOPMENT_PREVIOUS="false" | |
| diff --git a/composer.json b/composer.json | |
| index 8eb6b37..d70c69c 100644 | |
| --- a/composer.json | |
| +++ b/composer.json | |
| @@ -1,15 +1,16 @@ | |
| { | |
| "name": "ezsystems/ezpublish-legacy", | |
| "description": "eZ Publish LegacyStack (4.x)", | |
| - "version": "5.1-dev", | |
| - "homepage": "http://share.ez.no", | |
| - "license": "GPL-2.0", | |
| + "homepage": "http://share.ez.no", | |
| + "license": "GPL-2.0", | |
| + "type": "ezpublish-legacy", | |
| "require": { | |
| - "php": ">=5.3.3" | |
| + "php": ">=5.3.3", | |
| + "ezsystems/ezpublish-legacy-installer": "*" | |
| }, | |
| "extra": { | |
| "branch-alias": { | |
| - "dev-master": "5.1.x-dev" | |
| + "dev-master": "5.2.x-dev" | |
| } | |
| } | |
| } | |
| diff --git a/design/admin/templates/parts/content/menu.tpl b/design/admin/templates/parts/content/menu.tpl | |
| index 040e348..09b9193 100644 | |
| --- a/design/admin/templates/parts/content/menu.tpl | |
| +++ b/design/admin/templates/parts/content/menu.tpl | |
| @@ -17,11 +17,7 @@ | |
| </div> | |
| {/if} | |
| - | |
| - | |
| - | |
| {* DESIGN: Content END *}</div></div></div> | |
| - | |
| </div> | |
| {* See parts/ini_menu.tpl and menu.ini for more info, or parts/setup/menu.tpl for full example *} | |
| diff --git a/design/admin/templates/parts/ini_menu.tpl b/design/admin/templates/parts/ini_menu.tpl | |
| index 2bbf15f..ad7ded3 100644 | |
| --- a/design/admin/templates/parts/ini_menu.tpl | |
| +++ b/design/admin/templates/parts/ini_menu.tpl | |
| @@ -32,10 +32,17 @@ | |
| {if ezini_hasvariable( $ini_section, 'Links', 'menu.ini' )} | |
| {def $url_list = ezini( $ini_section, 'Links', 'menu.ini' ) | |
| $name_list = ezini( $ini_section, 'LinkNames', 'menu.ini' ) | |
| - $menu_name = ezini( $ini_section, 'Name', 'menu.ini' ) | |
| + $menu_name = '' | |
| $check = array() | |
| $has_access = true() | |
| - $item_name = ''} | |
| + $item_name = '' | |
| + $disabled = true() | |
| + $enabled_hash = hash() | |
| + $enabled_defaults = hash( 'default', 'true', 'edit', 'false', 'browse', 'false' )} | |
| + | |
| + {if ezini_hasvariable( $ini_section, 'Name', 'menu.ini' )} | |
| + {set $menu_name = ezini( $ini_section, 'Name', 'menu.ini' )} | |
| + {/if} | |
| {* Check access globally *} | |
| {if ezini_hasvariable( $ini_section, 'PolicyList', 'menu.ini' )} | |
| @@ -58,32 +65,35 @@ | |
| {if $has_access} | |
| {* DESIGN: Header START *}<div class="box-header"><div class="box-ml"> | |
| - <h4>{if is_set( $i18n_hash[ $menu_name ] )}{$i18n_hash[ $menu_name ]|wash}{else}{$menu_name|d18n($i18n_section)}{/if}</h4> | |
| + {if $menu_name}<h4>{if is_set( $i18n_hash[ $menu_name ] )}{$i18n_hash[ $menu_name ]|wash}{else}{$menu_name|d18n($i18n_section)}{/if}</h4>{/if} | |
| {* DESIGN: Header END *}</div></div> | |
| {* DESIGN: Content START *}<div class="box-bc"><div class="box-ml"><div class="box-content"> | |
| - {if eq( $ui_context, 'edit' )} | |
| - <ul class="leftmenu-items"> | |
| - {foreach $url_list as $link_key => $link_url} | |
| - {if is_set( $name_list[ $link_key ] )} | |
| - {set $item_name = $name_list[$link_key]|d18n($i18n_section)} | |
| - {else} | |
| - {set $item_name = first_set( $i18n_hash[ $link_key ], $link_key )|wash} | |
| - {/if} | |
| - <li><div><span class="disabled">{$item_name}</span></div></li> | |
| - {/foreach} | |
| - </ul> | |
| - {else} | |
| - <ul class="leftmenu-items"> | |
| - {foreach $url_list as $link_key => $link_url} | |
| - {if is_set( $name_list[ $link_key ] )} | |
| - {set $item_name = $name_list[$link_key]|d18n($i18n_section)} | |
| - {else} | |
| - {set $item_name = first_set( $i18n_hash[ $link_key ], $link_key )|wash} | |
| - {/if} | |
| + <ul class="leftmenu-items"> | |
| + {foreach $url_list as $link_key => $link_url} | |
| + {if is_set( $name_list[ $link_key ] )} | |
| + {set $item_name = $name_list[$link_key]|d18n($i18n_section)} | |
| + {else} | |
| + {set $item_name = first_set( $i18n_hash[ $link_key ], $link_key )|wash} | |
| + {/if} | |
| + | |
| + {* Check if link should be disabled *} | |
| + {if ezini_hasvariable( $ini_section, concat( 'Enabled_', $link_key ), 'menu.ini' )} | |
| + {set $enabled_hash = $enabled_defaults|merge( ezini( $ini_section, concat( 'Enabled_', $link_key ), 'menu.ini' ) )} | |
| + {else} | |
| + {set $enabled_hash = $enabled_defaults} | |
| + {/if} | |
| + | |
| + {if is_set( $enabled_hash[$ui_context] )} | |
| + {set $disabled = $enabled_hash[$ui_context]} | |
| + {else} | |
| + {set $disabled = $enabled_hash['default']|eq( 'false' )} | |
| + {/if} | |
| + | |
| + {* Check access per link *} | |
| + {if $disabled|not()} | |
| {set $has_access = true()} | |
| - {* Check access pr link *} | |
| {if ezini_hasvariable( $ini_section, concat( 'PolicyList_', $link_key ), 'menu.ini' )} | |
| {foreach ezini( $ini_section, concat( 'PolicyList_', $link_key ), 'menu.ini' ) as $policy} | |
| {if $policy|contains('/')} | |
| @@ -101,14 +111,16 @@ | |
| {/if} | |
| {/foreach} | |
| {/if} | |
| - {if $has_access} | |
| - <li{if $current_uri_string|begins_with( $link_url )} class="current"{/if}><div><a href={$link_url|ezurl}>{$item_name}</a></div></li> | |
| - {else} | |
| - <li class="disabled-no-access"><div><span class="disabled">{$item_name}</span></div></li> | |
| - {/if} | |
| - {/foreach} | |
| - </ul> | |
| - {/if} | |
| + {/if} | |
| + {if $disabled} | |
| + <li><div><span class="disabled">{$item_name}</span></div></li> | |
| + {elseif $has_access} | |
| + <li{if $current_uri_string|begins_with( $link_url )} class="current"{/if}><div><a href={$link_url|ezurl}>{$item_name}</a></div></li> | |
| + {else} | |
| + <li class="disabled-no-access"><div><span class="disabled">{$item_name}</span></div></li> | |
| + {/if} | |
| + {/foreach} | |
| + </ul> | |
| {* DESIGN: Content END *}</div></div></div> | |
| {/if} | |
| diff --git a/design/admin/templates/parts/media/menu.tpl b/design/admin/templates/parts/media/menu.tpl | |
| index e165a73..736d9e4 100644 | |
| --- a/design/admin/templates/parts/media/menu.tpl | |
| +++ b/design/admin/templates/parts/media/menu.tpl | |
| @@ -21,11 +21,9 @@ | |
| {* DESIGN: Content END *}</div></div></div> | |
| </div> | |
| - | |
| {* See parts/ini_menu.tpl and menu.ini for more info, or parts/setup/menu.tpl for full example *} | |
| {include uri='design:parts/ini_menu.tpl' ini_section='Leftmenu_media'} | |
| - | |
| {* Left menu width control. *} | |
| <div id="widthcontrol-links" class="widthcontrol"> | |
| <p> | |
| diff --git a/design/admin/templates/parts/user/menu.tpl b/design/admin/templates/parts/user/menu.tpl | |
| index 83d64e5..53b24e6 100644 | |
| --- a/design/admin/templates/parts/user/menu.tpl | |
| +++ b/design/admin/templates/parts/user/menu.tpl | |
| @@ -45,16 +45,12 @@ | |
| </div> | |
| {* Roles & policies *} | |
| -{if ne( $ui_context, 'browse')} | |
| - | |
| - {* See parts/ini_menu.tpl and menu.ini for more info, or parts/setup/menu.tpl for full example *} | |
| - {include uri='design:parts/ini_menu.tpl' ini_section='Leftmenu_user' i18n_hash=hash( | |
| - 'access_controll', 'Access control'|i18n( 'design/admin/parts/user/menu' ), | |
| - 'roles_and_policies', 'Roles and policies'|i18n( 'design/admin/parts/user/menu' ), | |
| - 'unactivated', 'Unactivated users'|i18n( 'design/admin/parts/user/menu' ), | |
| - )} | |
| - | |
| -{/if} | |
| +{* See parts/ini_menu.tpl and menu.ini for more info, or parts/setup/menu.tpl for full example *} | |
| +{include uri='design:parts/ini_menu.tpl' ini_section='Leftmenu_user' i18n_hash=hash( | |
| + 'access_controll', 'Access control'|i18n( 'design/admin/parts/user/menu' ), | |
| + 'roles_and_policies', 'Roles and policies'|i18n( 'design/admin/parts/user/menu' ), | |
| + 'unactivated', 'Unactivated users'|i18n( 'design/admin/parts/user/menu' ), | |
| +)} | |
| {* Left menu width control. *} | |
| <div id="widthcontrol-links" class="widthcontrol"> | |
| @@ -92,4 +88,4 @@ | |
| <div class="widthcontrol-grippy"></div> | |
| </div> | |
| -{/if} | |
| \ No newline at end of file | |
| +{/if}{* if ne( $ui_context, 'edit' ) *} | |
| diff --git a/doc/bc/5.2/changes-5.2.txt b/doc/bc/5.2/changes-5.2.txt | |
| index dde16b7..3981d86 100644 | |
| --- a/doc/bc/5.2/changes-5.2.txt | |
| +++ b/doc/bc/5.2/changes-5.2.txt | |
| @@ -4,6 +4,30 @@ Changes to BC and behavior in version 5.2 | |
| INI setting changes | |
| ------------------- | |
| +- content.ini[DataTypeSettings]AvailableDatatypes | |
| + | |
| + Since 5.2 AvailableDataTypes can be defined with a pair of dataype/class and so take | |
| + adventage of autoload mechanism reducing the number of file_exists and include calls. | |
| + You should update those of your extensions defining datatypes accordingly. | |
| + Ex: AvailableDatatypes[mycustom]=myCustomType | |
| + | |
| + Even this is now the recommended way to do it, the 'old' way is still valid. | |
| + The main adventage is that you will gain some file_exists and include calls. | |
| + You won't need to execute the eZDataType::register method from your dataype | |
| + class either. | |
| + | |
| +- workflow.ini[EventSettings]AvailableEventTypes | |
| + | |
| + Since 5.2 AvailableEventTypes can be defined with a pair of eventype/class and so take | |
| + adventage of autoload mechanism reducing the number of file_exists and include calls. | |
| + You should update those of your extensions defining workflows accordingly. | |
| + Ex: AvailableEventTypes[event_custom]=customType | |
| + | |
| + Even this is now the recommended way to do it, the 'old' way is still valid. | |
| + The main adventage is that you will gain some file_exists and include calls. | |
| + You won't need to execute the eZWorkflowEventType::registerEventType method | |
| + from your workflow class either. | |
| + | |
| Change of behavior | |
| ------------------ | |
| @@ -39,6 +63,18 @@ Change of behavior | |
| The previous default value (true) led to X-Powered-By being set to 1 (true cast to integer). | |
| From 5.2, the default value will be set to "eZ Publish". | |
| +- menu.ini\[Leftmenu_<menu>] | |
| + | |
| + Links in left menu are now by default disabled in browse mode. | |
| + This can now be changed per item using the new Enabled_<link>[<ui_context>] setting. | |
| + | |
| +- #019411: Avoid file_exists and include calls for registering datatypes and workflows | |
| + | |
| + Kernel datatypes and kernel workflow classes take now adventage of the autoload | |
| + mechanism. Autoload generator add these clasess to the autoload array, so there's no | |
| + need to do any of the file_exists or include calls. | |
| + | |
| + | |
| Removed features | |
| ---------------- | |
| diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile | |
| index d467a6a..d5a6a58 100644 | |
| --- a/doc/doxygen/Doxyfile | |
| +++ b/doc/doxygen/Doxyfile | |
| @@ -31,7 +31,7 @@ PROJECT_NAME = "eZ Publish " | |
| # This could be handy for archiving the generated documentation or | |
| # if some version control system is used. | |
| -PROJECT_NUMBER = 5.1.0alpha1 | |
| +PROJECT_NUMBER = 5.2.0alpha1 | |
| # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) | |
| # base path where the generated documentation will be put. | |
| diff --git a/doc/features/5.2/event.txt b/doc/features/5.2/event.txt | |
| new file mode 100644 | |
| index 0000000..b3dd493 | |
| --- /dev/null | |
| +++ b/doc/features/5.2/event.txt | |
| @@ -0,0 +1,9 @@ | |
| +Event system | |
| +============ | |
| + | |
| +- Added a new event for the content/download view (can be useful for tracking) | |
| + | |
| +New event | |
| +---------- | |
| + | |
| +content/download ( (int) $contentObjectID, (int) $contentObjectAttributeID ) | |
| diff --git a/extension/ezoe/design/standard/javascript/ezoe/popup_utils.js b/extension/ezoe/design/standard/javascript/ezoe/popup_utils.js | |
| index c5fea2d..0b8a59a 100644 | |
| --- a/extension/ezoe/design/standard/javascript/ezoe/popup_utils.js | |
| +++ b/extension/ezoe/design/standard/javascript/ezoe/popup_utils.js | |
| @@ -50,6 +50,8 @@ var eZOEPopupUtils = { | |
| editorSelectedText: false, | |
| // Same as above but with markup | |
| editorSelectedHtml: false, | |
| + // the selected node in the editor, set on init | |
| + editorSelectedNode: false, | |
| // generates class name for tr elements in browse / search / bookmark list | |
| browseClassGenerator: function(){ return ''; }, | |
| // generates browse link for a specific mode | |
| @@ -109,6 +111,7 @@ var eZOEPopupUtils = { | |
| if ( jQuery.trim( selectedHtml ) !== '' ) | |
| s.editorSelectedHtml = selectedHtml; | |
| } | |
| + s.editorSelectedNode = ed.selection.getNode(); | |
| if ( s.onInit && s.onInit.call ) | |
| s.onInit.call( eZOEPopupUtils, s.editorElement, s.tagName, ed ); | |
| @@ -308,7 +311,8 @@ var eZOEPopupUtils = { | |
| */ | |
| insertTagCleanly: function( ed, tag, content, args ) | |
| { | |
| - var edCurrentNode = ed.selection.getNode(), newElement = edCurrentNode.ownerDocument.createElement( tag ); | |
| + var edCurrentNode = eZOEPopupUtils.settings.editorSelectedNode ? eZOEPopupUtils.settings.editorSelectedNode : ed.selection.getNode(), | |
| + newElement = edCurrentNode.ownerDocument.createElement( tag ); | |
| if ( tag !== 'img' ) newElement.innerHTML = content; | |
| if ( edCurrentNode.nodeName === 'TD' ) | |
| diff --git a/extension/ezoe/design/standard/templates/ezoe/tag_embed_files.tpl b/extension/ezoe/design/standard/templates/ezoe/tag_embed_files.tpl | |
| index b78030c..8909367 100644 | |
| --- a/extension/ezoe/design/standard/templates/ezoe/tag_embed_files.tpl | |
| +++ b/extension/ezoe/design/standard/templates/ezoe/tag_embed_files.tpl | |
| @@ -45,8 +45,8 @@ tinyMCEPopup.onInit.add( eZOEPopupUtils.BIND( eZOEPopupUtils.init, window, { | |
| { | |
| if ( contentType === 'images' || compatibilityMode === 'enabled' ) | |
| return '<img id="__mce_tmp" src="JavaScript:void(0);" />'; | |
| - if ( jQuery('#embed_inline_source').attr( 'checked' ) ) | |
| - return '<span id="__mce_tmp"></span>'; | |
| + if ( jQuery('#embed_inline_source').prop( 'checked' ) ) | |
| + return '<span id="__mce_tmp">ezembed</span>'; | |
| return '<div id="__mce_tmp"></div>'; | |
| }, | |
| onTagGenerated: function( el, ed, args ) | |
| diff --git a/extension/ezoe/design/standard/templates/ezoe/tag_embed_objects.tpl b/extension/ezoe/design/standard/templates/ezoe/tag_embed_objects.tpl | |
| index 563e442..88a2325 100755 | |
| --- a/extension/ezoe/design/standard/templates/ezoe/tag_embed_objects.tpl | |
| +++ b/extension/ezoe/design/standard/templates/ezoe/tag_embed_objects.tpl | |
| @@ -46,8 +46,8 @@ tinyMCEPopup.onInit.add( eZOEPopupUtils.BIND( eZOEPopupUtils.init, window, { | |
| { | |
| if ( contentType === 'images' || compatibilityMode === 'enabled' ) | |
| return '<img id="__mce_tmp" src="JavaScript:void(0);" />'; | |
| - if ( jQuery('#embed_inline_source').attr( 'checked' ) ) | |
| - return '<span id="__mce_tmp"></span>'; | |
| + if ( jQuery('#embed_inline_source').prop( 'checked' ) ) | |
| + return '<span id="__mce_tmp">ezembed</span>'; | |
| return '<div id="__mce_tmp"></div>'; | |
| }, | |
| onTagGenerated: function( el, ed, args ) | |
| diff --git a/kernel/classes/datatypes/ezauthor/ezauthortype.php b/kernel/classes/datatypes/ezauthor/ezauthortype.php | |
| index 32e4f37..d356afa 100644 | |
| --- a/kernel/classes/datatypes/ezauthor/ezauthortype.php | |
| +++ b/kernel/classes/datatypes/ezauthor/ezauthortype.php | |
| @@ -304,6 +304,4 @@ class eZAuthorType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZAuthorType::DATA_TYPE_STRING, "eZAuthorType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php b/kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php | |
| index 1ac6c7d..5b6a336 100644 | |
| --- a/kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php | |
| +++ b/kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php | |
| @@ -752,6 +752,4 @@ class eZBinaryFileType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZBinaryFileType::DATA_TYPE_STRING, "eZBinaryFileType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezboolean/ezbooleantype.php b/kernel/classes/datatypes/ezboolean/ezbooleantype.php | |
| index 88b88a7..8db0646 100644 | |
| --- a/kernel/classes/datatypes/ezboolean/ezbooleantype.php | |
| +++ b/kernel/classes/datatypes/ezboolean/ezbooleantype.php | |
| @@ -245,6 +245,4 @@ class eZBooleanType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZBooleanType::DATA_TYPE_STRING, "eZBooleanType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezcountry/ezcountrytype.php b/kernel/classes/datatypes/ezcountry/ezcountrytype.php | |
| index 42ca9cf..ab396e8 100644 | |
| --- a/kernel/classes/datatypes/ezcountry/ezcountrytype.php | |
| +++ b/kernel/classes/datatypes/ezcountry/ezcountrytype.php | |
| @@ -457,6 +457,4 @@ class eZCountryType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZCountryType::DATA_TYPE_STRING, 'ezcountrytype' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezdate/ezdatetype.php b/kernel/classes/datatypes/ezdate/ezdatetype.php | |
| index b0c4c9b..8924d32 100644 | |
| --- a/kernel/classes/datatypes/ezdate/ezdatetype.php | |
| +++ b/kernel/classes/datatypes/ezdate/ezdatetype.php | |
| @@ -375,6 +375,4 @@ class eZDateType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZDateType::DATA_TYPE_STRING, "eZDateType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php b/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php | |
| index 5a3c3d8..f7687de 100644 | |
| --- a/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php | |
| +++ b/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php | |
| @@ -626,6 +626,4 @@ class eZDateTimeType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZDateTimeType::DATA_TYPE_STRING, "eZDateTimeType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezemail/ezemailtype.php b/kernel/classes/datatypes/ezemail/ezemailtype.php | |
| index d1bbd0a..1ffe5c9 100644 | |
| --- a/kernel/classes/datatypes/ezemail/ezemailtype.php | |
| +++ b/kernel/classes/datatypes/ezemail/ezemailtype.php | |
| @@ -226,6 +226,4 @@ class eZEmailType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZEmailType::DATA_TYPE_STRING, "eZEmailType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezenum/ezenumtype.php b/kernel/classes/datatypes/ezenum/ezenumtype.php | |
| index f8054f3..d014ace 100644 | |
| --- a/kernel/classes/datatypes/ezenum/ezenumtype.php | |
| +++ b/kernel/classes/datatypes/ezenum/ezenumtype.php | |
| @@ -514,6 +514,5 @@ class eZEnumType extends eZDataType | |
| return null; | |
| } | |
| } | |
| -eZDataType::register( eZEnumType::DATA_TYPE_STRING, 'eZEnumType' ); | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezfloat/ezfloattype.php b/kernel/classes/datatypes/ezfloat/ezfloattype.php | |
| index d3a8be2..ed2f2e6 100644 | |
| --- a/kernel/classes/datatypes/ezfloat/ezfloattype.php | |
| +++ b/kernel/classes/datatypes/ezfloat/ezfloattype.php | |
| @@ -410,6 +410,4 @@ class eZFloatType extends eZDataType | |
| public $FloatValidator; | |
| } | |
| -eZDataType::register( eZFloatType::DATA_TYPE_STRING, "eZFloatType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezidentifier/ezidentifiertype.php b/kernel/classes/datatypes/ezidentifier/ezidentifiertype.php | |
| index 1494767..c38ee50 100644 | |
| --- a/kernel/classes/datatypes/ezidentifier/ezidentifiertype.php | |
| +++ b/kernel/classes/datatypes/ezidentifier/ezidentifiertype.php | |
| @@ -422,6 +422,4 @@ class eZIdentifierType extends eZDataType | |
| public $IntegerValidator; | |
| } | |
| -eZDataType::register( eZIdentifierType::DATA_TYPE_STRING, "ezidentifiertype" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezimage/ezimagetype.php b/kernel/classes/datatypes/ezimage/ezimagetype.php | |
| index 1fd87ad..9f525b5 100644 | |
| --- a/kernel/classes/datatypes/ezimage/ezimagetype.php | |
| +++ b/kernel/classes/datatypes/ezimage/ezimagetype.php | |
| @@ -632,6 +632,4 @@ class eZImageType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZImageType::DATA_TYPE_STRING, "eZImageType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezinisetting/ezinisettingtype.php b/kernel/classes/datatypes/ezinisetting/ezinisettingtype.php | |
| index 1dfebb9..be07aaa 100644 | |
| --- a/kernel/classes/datatypes/ezinisetting/ezinisettingtype.php | |
| +++ b/kernel/classes/datatypes/ezinisetting/ezinisettingtype.php | |
| @@ -622,6 +622,4 @@ class eZIniSettingType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZIniSettingType::DATA_TYPE_STRING, 'eZIniSettingType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezinteger/ezintegertype.php b/kernel/classes/datatypes/ezinteger/ezintegertype.php | |
| index 8f05f0c..547925f 100644 | |
| --- a/kernel/classes/datatypes/ezinteger/ezintegertype.php | |
| +++ b/kernel/classes/datatypes/ezinteger/ezintegertype.php | |
| @@ -503,6 +503,4 @@ class eZIntegerType extends eZDataType | |
| public $IntegerValidator; | |
| } | |
| -eZDataType::register( eZIntegerType::DATA_TYPE_STRING, "eZIntegerType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezisbn/ezisbntype.php b/kernel/classes/datatypes/ezisbn/ezisbntype.php | |
| index 559a9ae..80061c6 100644 | |
| --- a/kernel/classes/datatypes/ezisbn/ezisbntype.php | |
| +++ b/kernel/classes/datatypes/ezisbn/ezisbntype.php | |
| @@ -430,6 +430,4 @@ class eZISBNType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZISBNType::DATA_TYPE_STRING, "eZISBNType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezkeyword/ezkeywordtype.php b/kernel/classes/datatypes/ezkeyword/ezkeywordtype.php | |
| index 0c7d447..ad05b05 100644 | |
| --- a/kernel/classes/datatypes/ezkeyword/ezkeywordtype.php | |
| +++ b/kernel/classes/datatypes/ezkeyword/ezkeywordtype.php | |
| @@ -286,6 +286,4 @@ class eZKeywordType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZKeywordType::DATA_TYPE_STRING, 'eZKeywordType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezmatrix/ezmatrixtype.php b/kernel/classes/datatypes/ezmatrix/ezmatrixtype.php | |
| index 032132a..4af87df 100644 | |
| --- a/kernel/classes/datatypes/ezmatrix/ezmatrixtype.php | |
| +++ b/kernel/classes/datatypes/ezmatrix/ezmatrixtype.php | |
| @@ -516,6 +516,4 @@ class eZMatrixType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZMatrixType::DATA_TYPE_STRING, 'ezmatrixtype' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezmedia/ezmediatype.php b/kernel/classes/datatypes/ezmedia/ezmediatype.php | |
| index 7749ca0..42c6b56 100644 | |
| --- a/kernel/classes/datatypes/ezmedia/ezmediatype.php | |
| +++ b/kernel/classes/datatypes/ezmedia/ezmediatype.php | |
| @@ -796,6 +796,4 @@ class eZMediaType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZMediaType::DATA_TYPE_STRING, "eZMediaType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezmultioption/ezmultioptiontype.php b/kernel/classes/datatypes/ezmultioption/ezmultioptiontype.php | |
| index 948cbeb..373d8e8 100644 | |
| --- a/kernel/classes/datatypes/ezmultioption/ezmultioptiontype.php | |
| +++ b/kernel/classes/datatypes/ezmultioption/ezmultioptiontype.php | |
| @@ -457,6 +457,4 @@ class eZMultiOptionType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZMultiOptionType::DATA_TYPE_STRING, "eZMultiOptionType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezmultioption2/ezmultioption2type.php b/kernel/classes/datatypes/ezmultioption2/ezmultioption2type.php | |
| index 65cdcc2..9a75c33 100644 | |
| --- a/kernel/classes/datatypes/ezmultioption2/ezmultioption2type.php | |
| +++ b/kernel/classes/datatypes/ezmultioption2/ezmultioption2type.php | |
| @@ -669,6 +669,4 @@ class eZMultiOption2Type extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZMultiOption2Type::DATA_TYPE_STRING, "eZMultiOption2Type" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezmultiprice/ezmultipricetype.php b/kernel/classes/datatypes/ezmultiprice/ezmultipricetype.php | |
| index cb6864e..6e9e6aa 100644 | |
| --- a/kernel/classes/datatypes/ezmultiprice/ezmultipricetype.php | |
| +++ b/kernel/classes/datatypes/ezmultiprice/ezmultipricetype.php | |
| @@ -525,6 +525,4 @@ class eZMultiPriceType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZMultiPriceType::DATA_TYPE_STRING, "eZMultiPriceType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php b/kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php | |
| index 9abc4bf..026291c 100644 | |
| --- a/kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php | |
| +++ b/kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php | |
| @@ -642,6 +642,4 @@ class eZObjectRelationType extends eZDataType | |
| /// \privatesection | |
| } | |
| -eZDataType::register( eZObjectRelationType::DATA_TYPE_STRING, "eZObjectRelationType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php b/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php | |
| index 1b9b516..816403c 100644 | |
| --- a/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php | |
| +++ b/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php | |
| @@ -1864,6 +1864,4 @@ class eZObjectRelationListType extends eZDataType | |
| /// \privatesection | |
| } | |
| -eZDataType::register( eZObjectRelationListType::DATA_TYPE_STRING, "eZObjectRelationListType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezoption/ezoptiontype.php b/kernel/classes/datatypes/ezoption/ezoptiontype.php | |
| index e964791..738f5b7 100644 | |
| --- a/kernel/classes/datatypes/ezoption/ezoptiontype.php | |
| +++ b/kernel/classes/datatypes/ezoption/ezoptiontype.php | |
| @@ -442,6 +442,4 @@ class eZOptionType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZOptionType::DATA_TYPE_STRING, "eZOptionType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezpackage/ezpackagetype.php b/kernel/classes/datatypes/ezpackage/ezpackagetype.php | |
| index 2c55967..836c3b5 100644 | |
| --- a/kernel/classes/datatypes/ezpackage/ezpackagetype.php | |
| +++ b/kernel/classes/datatypes/ezpackage/ezpackagetype.php | |
| @@ -222,6 +222,4 @@ class eZPackageType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZPackageType::DATA_TYPE_STRING, 'eZPackageType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezprice/ezpricetype.php b/kernel/classes/datatypes/ezprice/ezpricetype.php | |
| index 9234318..5c7198f 100644 | |
| --- a/kernel/classes/datatypes/ezprice/ezpricetype.php | |
| +++ b/kernel/classes/datatypes/ezprice/ezpricetype.php | |
| @@ -319,6 +319,4 @@ class eZPriceType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZPriceType::DATA_TYPE_STRING, "eZPriceType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezproductcategory/ezproductcategorytype.php b/kernel/classes/datatypes/ezproductcategory/ezproductcategorytype.php | |
| index 8d15be7..5cb0be4 100644 | |
| --- a/kernel/classes/datatypes/ezproductcategory/ezproductcategorytype.php | |
| +++ b/kernel/classes/datatypes/ezproductcategory/ezproductcategorytype.php | |
| @@ -210,6 +210,4 @@ class eZProductCategoryType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZProductCategoryType::DATA_TYPE_STRING, "eZProductCategoryType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezrangeoption/ezrangeoptiontype.php b/kernel/classes/datatypes/ezrangeoption/ezrangeoptiontype.php | |
| index 4698a2e..56593e0 100644 | |
| --- a/kernel/classes/datatypes/ezrangeoption/ezrangeoptiontype.php | |
| +++ b/kernel/classes/datatypes/ezrangeoption/ezrangeoptiontype.php | |
| @@ -271,6 +271,4 @@ class eZRangeOptionType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZRangeOptionType::DATA_TYPE_STRING, "eZRangeOptionType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezselection/ezselectiontype.php b/kernel/classes/datatypes/ezselection/ezselectiontype.php | |
| index b9a682a..9c61f4f 100644 | |
| --- a/kernel/classes/datatypes/ezselection/ezselectiontype.php | |
| +++ b/kernel/classes/datatypes/ezselection/ezselectiontype.php | |
| @@ -446,5 +446,4 @@ class eZSelectionType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZSelectionType::DATA_TYPE_STRING, "eZSelectionType" ); | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezstring/ezstringtype.php b/kernel/classes/datatypes/ezstring/ezstringtype.php | |
| index 6324033..4631e61 100644 | |
| --- a/kernel/classes/datatypes/ezstring/ezstringtype.php | |
| +++ b/kernel/classes/datatypes/ezstring/ezstringtype.php | |
| @@ -383,6 +383,4 @@ class eZStringType extends eZDataType | |
| public $MaxLenValidator; | |
| } | |
| -eZDataType::register( eZStringType::DATA_TYPE_STRING, 'eZStringType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezsubtreesubscription/ezsubtreesubscriptiontype.php b/kernel/classes/datatypes/ezsubtreesubscription/ezsubtreesubscriptiontype.php | |
| index 5ce334d..ef4afb1 100644 | |
| --- a/kernel/classes/datatypes/ezsubtreesubscription/ezsubtreesubscriptiontype.php | |
| +++ b/kernel/classes/datatypes/ezsubtreesubscription/ezsubtreesubscriptiontype.php | |
| @@ -138,6 +138,4 @@ class eZSubtreeSubscriptionType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZSubtreeSubscriptionType::DATA_TYPE_STRING, "eZSubtreeSubscriptionType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/eztext/eztexttype.php b/kernel/classes/datatypes/eztext/eztexttype.php | |
| index 203bd0b..9e9b376 100644 | |
| --- a/kernel/classes/datatypes/eztext/eztexttype.php | |
| +++ b/kernel/classes/datatypes/eztext/eztexttype.php | |
| @@ -262,6 +262,4 @@ class eZTextType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZTextType::DATA_TYPE_STRING, "eZTextType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/eztime/eztimetype.php b/kernel/classes/datatypes/eztime/eztimetype.php | |
| index a462b64..dca22c8 100644 | |
| --- a/kernel/classes/datatypes/eztime/eztimetype.php | |
| +++ b/kernel/classes/datatypes/eztime/eztimetype.php | |
| @@ -443,6 +443,4 @@ class eZTimeType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZTimeType::DATA_TYPE_STRING, "eZTimeType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezurl/ezurltype.php b/kernel/classes/datatypes/ezurl/ezurltype.php | |
| index 239fa34..792bbeb 100644 | |
| --- a/kernel/classes/datatypes/ezurl/ezurltype.php | |
| +++ b/kernel/classes/datatypes/ezurl/ezurltype.php | |
| @@ -369,6 +369,4 @@ class eZURLType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZURLType::DATA_TYPE_STRING, 'eZURLType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezuser/ezuser.php b/kernel/classes/datatypes/ezuser/ezuser.php | |
| index 756bfb0..4d694df 100644 | |
| --- a/kernel/classes/datatypes/ezuser/ezuser.php | |
| +++ b/kernel/classes/datatypes/ezuser/ezuser.php | |
| @@ -1158,7 +1158,7 @@ WHERE user_id = '" . $userID . "' AND | |
| eZUser::updateLastVisit( $userId ); | |
| eZUser::setCurrentlyLoggedInUser( $currentUser, $userId ); | |
| - eZHTTPTool::redirect( eZSys::wwwDir() . eZSys::indexFile( false ) . eZSys::requestURI(), array(), 302 ); | |
| + eZHTTPTool::redirect( eZSys::wwwDir() . eZSys::indexFile( false ) . eZSys::requestURI() . eZSys::queryString(), array(), 302 ); | |
| eZExecution::cleanExit(); | |
| } | |
| } | |
| diff --git a/kernel/classes/datatypes/ezuser/ezusertype.php b/kernel/classes/datatypes/ezuser/ezusertype.php | |
| index fe15814..9e59f00 100644 | |
| --- a/kernel/classes/datatypes/ezuser/ezusertype.php | |
| +++ b/kernel/classes/datatypes/ezuser/ezusertype.php | |
| @@ -529,6 +529,4 @@ class eZUserType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZUserType::DATA_TYPE_STRING, "eZUserType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/datatypes/ezxmltext/ezxmltexttype.php b/kernel/classes/datatypes/ezxmltext/ezxmltexttype.php | |
| index 2335f9e..fd189de 100644 | |
| --- a/kernel/classes/datatypes/ezxmltext/ezxmltexttype.php | |
| +++ b/kernel/classes/datatypes/ezxmltext/ezxmltexttype.php | |
| @@ -845,6 +845,4 @@ class eZXMLTextType extends eZDataType | |
| } | |
| } | |
| -eZDataType::register( eZXMLTextType::DATA_TYPE_STRING, "eZXMLTextType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/ezcontentobject.php b/kernel/classes/ezcontentobject.php | |
| index dd95efb..26563ed 100644 | |
| --- a/kernel/classes/ezcontentobject.php | |
| +++ b/kernel/classes/ezcontentobject.php | |
| @@ -2847,7 +2847,7 @@ class eZContentObject extends eZPersistentObject | |
| if ( $attributeID && ( $relationTypeMask === false || $relationTypeMask === eZContentObject::RELATION_ATTRIBUTE ) ) | |
| { | |
| $attributeID =(int) $attributeID; | |
| - $relationTypeMasking .= " AND contentclassattribute_id=$attributeID "; | |
| + $relationTypeMasking .= " contentclassattribute_id=$attributeID AND "; | |
| $relationTypeMask = eZContentObject::RELATION_ATTRIBUTE; | |
| } | |
| elseif ( is_bool( $relationTypeMask ) ) | |
| diff --git a/kernel/classes/ezcontentobjecttreenode.php b/kernel/classes/ezcontentobjecttreenode.php | |
| index bd3b6a2..221d300 100644 | |
| --- a/kernel/classes/ezcontentobjecttreenode.php | |
| +++ b/kernel/classes/ezcontentobjecttreenode.php | |
| @@ -8,36 +8,11 @@ | |
| * @package kernel | |
| */ | |
| -/*! | |
| - \class eZContentObjectTreeNode ezcontentobjecttreenode.php | |
| - \brief The class eZContentObjectTreeNode does | |
| - | |
| -\verbatim | |
| - | |
| -Some algorithms | |
| ----------- | |
| -1. Adding new Node | |
| -Enter 1 - parent_node | |
| - 2 - contentobject_id, ( that is like a node value ) | |
| - | |
| -(a) - get path_string, depth for parent node to built path_string and to count depth for new one | |
| -(c) - calculating attributes for new node and inserting it | |
| -Returns node_id for added node | |
| - | |
| - | |
| -2. Deleting node ( or subtree ) | |
| -Enter - node_id | |
| - | |
| -3. Move subtree in tree | |
| -Enter node_id,new_parent_id | |
| - | |
| - | |
| -4. fetching subtree | |
| - | |
| -\endverbatim | |
| - | |
| -*/ | |
| - | |
| +/** | |
| + * Encapsulates data about and methods to work with content objects inside the content object tree | |
| + * | |
| + * @package kernel | |
| + */ | |
| class eZContentObjectTreeNode extends eZPersistentObject | |
| { | |
| const SORT_FIELD_PATH = 1; | |
| @@ -56,14 +31,23 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| const SORT_ORDER_DESC = 0; | |
| const SORT_ORDER_ASC = 1; | |
| - /*! | |
| - Constructor | |
| - */ | |
| + /** | |
| + * Initializes the object with the $row. | |
| + * | |
| + * It will try to set each field taken from the database row. Calls fill | |
| + * to do the job. If $row is an integer, it will try to fetch it from the | |
| + * database using it as the unique ID. | |
| + * | |
| + * @param int|array $row | |
| + */ | |
| function eZContentObjectTreeNode( $row = array() ) | |
| { | |
| $this->eZPersistentObject( $row ); | |
| } | |
| + /** | |
| + * @inheritdoc | |
| + */ | |
| static function definition() | |
| { | |
| static $definition = array( "fields" => array( "node_id" => array( 'name' => "NodeID", | |
| @@ -181,15 +165,19 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $definition; | |
| } | |
| - /*! | |
| - Creates a new tree node and returns it. | |
| - \param $parentNodeID The ID of the parent or \c null if the node is not known yet. | |
| - \param $contentObjectID The ID of the object it points to or \c null if it is not known yet. | |
| - \param $contentObjectVersion The version of the object or \c 0 if not known yet. | |
| - \param $sortField Number describing the field to sort by, or \c 0 if not known yet. | |
| - \param $sortOrder Which way to sort, \c true means ascending while \c false is descending. | |
| - \note The attribute \c remote_id will get an automatic and unique value. | |
| - */ | |
| + /** | |
| + * Creates a new tree node and returns it. | |
| + * | |
| + * The attribute remote_id will get an automatic and unique value. | |
| + * | |
| + * @param int $parentNodeID The ID of the parent or null if the node is not known yet. | |
| + * @param int $contentObjectID The ID of the object it points to or null if it is not known yet. | |
| + * @param int $contentObjectVersion The version of the object or 0 if not known yet. | |
| + * @param int $sortField Number describing the field to sort by, or 0 if not known yet. | |
| + * @param bool $sortOrder Which way to sort, true means ascending while false is descending. | |
| + * | |
| + * @return eZContentObjectTreeNode | |
| + */ | |
| static function create( $parentNodeID = null, $contentObjectID = null, $contentObjectVersion = 0, | |
| $sortField = 0, $sortOrder = true ) | |
| { | |
| @@ -233,11 +221,12 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| self::$useCurrentUserDraft = (bool) $enable; | |
| } | |
| - /*! | |
| - \return a map with all the content object attributes where the keys are the | |
| - attribute identifiers. | |
| - \sa eZContentObject::fetchDataMap | |
| - */ | |
| + /** | |
| + * Returns an array with all the content object attributes where the keys are the attribute identifiers. | |
| + * | |
| + * @see eZContentObject::fetchDataMap() | |
| + * @return eZContentObjectAttribute[] | |
| + */ | |
| function dataMap() | |
| { | |
| $object = $this->object(); | |
| @@ -256,10 +245,15 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $object->fetchDataMap( $this->attribute( 'contentobject_version' ) ); | |
| } | |
| - /*! | |
| - Get remote id of content node, the remote ID is often used to synchronise imports and exports. | |
| - If there is no remote ID a new unique one will be generated. | |
| - */ | |
| + /** | |
| + * Get the remote id of content node | |
| + * | |
| + * If there is no remote ID a new unique one will be generated. | |
| + * | |
| + * The remote ID is often used to synchronise imports and exports. | |
| + * | |
| + * @return string | |
| + */ | |
| function remoteID() | |
| { | |
| $remoteID = $this->attribute( 'remote_id', true ); | |
| @@ -273,38 +267,45 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $remoteID; | |
| } | |
| - /*! | |
| - \return true if this node is the main node. | |
| + /** | |
| + * Returns true if this node is the main node. | |
| + * | |
| + * @return bool | |
| */ | |
| function isMain() | |
| { | |
| return $this->NodeID == $this->MainNodeID; | |
| } | |
| - /*! | |
| - \return the ID of the class attribute with the given ID. | |
| - False is returned if no class/attribute by that identifier is found. | |
| - If multiple classes have the same identifier, the first found is returned. | |
| - */ | |
| + /** | |
| + * Returns the ID of the class attribute with the given ID or false if no class/attribute by that identifier | |
| + * is found. If multiple classes have the same identifier, the first found is returned. | |
| + * | |
| + * @param string $identifier | |
| + * @return int|bool | |
| + */ | |
| static function classAttributeIDByIdentifier( $identifier ) | |
| { | |
| return eZContentClassAttribute::classAttributeIDByIdentifier( $identifier ); | |
| } | |
| - /*! | |
| - \return the ID of the class with the given ID. | |
| - False is returned if no class by that identifier is found. | |
| - If multiple classes have the same identifier, the first found is returned. | |
| - */ | |
| + /** | |
| + * Return the ID of the class with the given ID or false if no class by that identifier is found. | |
| + * If multiple classes have the same identifier, the first found is returned. | |
| + * | |
| + * @param string $identifier | |
| + * @return int|bool | |
| + */ | |
| static function classIDByIdentifier( $identifier ) | |
| { | |
| return eZContentClass::classIDByIdentifier( $identifier ); | |
| } | |
| - /*! | |
| - \return \c true if the node can be read by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be read by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canRead( ) | |
| { | |
| if ( !isset( $this->Permissions["can_read"] ) ) | |
| @@ -314,9 +315,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_read"] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if the current user can create a pdf of this content object. | |
| - */ | |
| + /** | |
| + * Returns true if the current user can create a pdf of this content object. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canPdf( ) | |
| { | |
| if ( !isset( $this->Permissions["can_pdf"] ) ) | |
| @@ -326,11 +329,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_pdf"] == 1 ); | |
| } | |
| - | |
| - /*! | |
| - \return \c true if the node can be viewed as embeded object by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be viewed as embeded object by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canViewEmbed( ) | |
| { | |
| if ( !isset( $this->Permissions["can_view_embed"] ) ) | |
| @@ -340,10 +343,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_view_embed"] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if the node can be edited by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be edited by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canEdit( ) | |
| { | |
| if ( !isset( $this->Permissions["can_edit"] ) ) | |
| @@ -365,10 +369,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_edit"] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if the node can be hidden by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be hidden by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canHide( ) | |
| { | |
| if ( !isset( $this->Permissions["can_hide"] ) ) | |
| @@ -378,10 +383,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_hide"] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if the current user can create a new node as child of this node. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the current user can create a new node as child of this node. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canCreate( ) | |
| { | |
| if ( !isset( $this->Permissions["can_create"] ) ) | |
| @@ -391,10 +397,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_create"] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if the node can be removed by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be removed by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canRemove( ) | |
| { | |
| if ( !isset( $this->Permissions["can_remove"] ) ) | |
| @@ -404,11 +411,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions["can_remove"] == 1 ); | |
| } | |
| - /*! | |
| - Check if the node can be moved. (actually checks 'edit' and 'remove' permissions) | |
| - \return \c true if the node can be moved by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if the node can be moved by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canMoveFrom( ) | |
| { | |
| if ( !isset( $this->Permissions['can_move_from'] ) ) | |
| @@ -418,10 +425,12 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions['can_move_from'] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if a node of class \a $classID can be moved to the current node by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if a node of class $classID can be moved to the current node by the current user. | |
| + * | |
| + * @param bool $classID | |
| + * @return bool | |
| + */ | |
| function canMoveTo( $classID = false ) | |
| { | |
| if ( !isset( $this->Permissions['can_move_to'] ) ) | |
| @@ -431,10 +440,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions['can_move_to'] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if a node can be swaped by the current user. | |
| - \sa checkAccess(). | |
| - */ | |
| + /** | |
| + * Returns true if a node can be swaped by the current user. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canSwap() | |
| { | |
| if ( !isset( $this->Permissions['can_swap'] ) ) | |
| @@ -444,10 +454,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions['can_swap'] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if current user can add object locations to current node. | |
| - \sa checkAccess() | |
| - */ | |
| + /** | |
| + * Returns true if current user can add object locations to current node. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canAddLocation() | |
| { | |
| if ( !isset( $this->Permissions['can_add_location'] ) ) | |
| @@ -457,9 +468,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions['can_add_location'] == 1 ); | |
| } | |
| - /*! | |
| - \return \c true if current user can add object locations to current node. | |
| - */ | |
| + /** | |
| + * Returns true if current user can add object locations to current node. | |
| + * | |
| + * @return bool | |
| + */ | |
| function canRemoveLocation() | |
| { | |
| if ( !isset( $this->Permissions['can_remove_location'] ) ) | |
| @@ -469,28 +482,33 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ( $this->Permissions['can_remove_location'] == 1 ); | |
| } | |
| - /*! | |
| - \static | |
| - \returns the sort key for the given classAttributeID. | |
| - int|string is returend. False is returned if unsuccessful. | |
| - */ | |
| + /** | |
| + * Returns the sort key for the given classAttributeID or false if it can't be retrieved | |
| + * | |
| + * @param int $classAttributeID | |
| + * @return int|string|bool | |
| + */ | |
| static function sortKeyByClassAttributeID( $classAttributeID ) | |
| { | |
| return eZContentClassAttribute::sortKeyTypeByID( $classAttributeID ); | |
| } | |
| - /*! | |
| - \static | |
| - */ | |
| + /** | |
| + * Returns the datatype of a class attribute | |
| + * | |
| + * @param int $classAttributeID | |
| + * @return string | |
| + */ | |
| static function dataTypeByClassAttributeID( $classAttributeID ) | |
| { | |
| return eZContentClassAttribute::dataTypeByID( $classAttributeID ); | |
| } | |
| - | |
| - /*! | |
| - Fetches the number of nodes which exists in the system. | |
| - */ | |
| + /** | |
| + * Fetches the number of nodes which exists in the system. | |
| + * | |
| + * @return int | |
| + */ | |
| static function fetchListCount() | |
| { | |
| $sql = "SELECT count( node_id ) as count FROM ezcontentobject_tree"; | |
| @@ -499,10 +517,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $rows[0]['count']; | |
| } | |
| - | |
| - /*! | |
| - Fetches a list of nodes and returns it. Offset and limitation can be set if needed. | |
| - */ | |
| + /** | |
| + * Fetches a list of nodes and returns it. Offset and limitation can be set if needed. | |
| + * | |
| + * @param bool $asObject | |
| + * @param int|bool $offset | |
| + * @param int|bool $limit | |
| + * @return eZContentObjectTreeNode[] | |
| + */ | |
| static function fetchList( $asObject = true, $offset = false, $limit = false ) | |
| { | |
| $sql = "SELECT * FROM ezcontentobject_tree"; | |
| @@ -526,9 +548,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $rows; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Creates an array with sorting SQL strings to be appended to a query | |
| + * | |
| + * @param array|bool $sortList | |
| + * @param string $treeTableName | |
| + * @param bool $allowCustomColumns | |
| + * @return array | |
| + */ | |
| static function createSortingSQLStrings( $sortList, $treeTableName = 'ezcontentobject_tree', $allowCustomColumns = false ) | |
| { | |
| $sortingInfo = array( 'sortCount' => 0, | |
| @@ -740,9 +767,13 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $sortingInfo; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Returns an SQL string to filter query results by classes | |
| + * | |
| + * @param string|bool $classFilterType | |
| + * @param array $classFilterArray | |
| + * @return string|bool | |
| + */ | |
| static function createClassFilteringSQLString( $classFilterType, &$classFilterArray ) | |
| { | |
| // Check for class filtering | |
| @@ -797,9 +828,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $classCondition; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Creates a filter array from extended attribute filters | |
| + * | |
| + * The filter array includes tables, joins, columns and grouping information | |
| + * | |
| + * @param array $extendedAttributeFilter | |
| + * @return array | |
| + */ | |
| static function createExtendedAttributeFilterSQLStrings( &$extendedAttributeFilter ) | |
| { | |
| $filter = array( 'tables' => '', | |
| @@ -859,9 +895,12 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $filter; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * If $mainNodeOnly is set to true, creates an SQL part which makes sure the fetched node(s) are main nodes | |
| + * | |
| + * @param bool $mainNodeOnly | |
| + * @return string | |
| + */ | |
| static function createMainNodeConditionSQLString( $mainNodeOnly ) | |
| { | |
| // Main node check | |
| @@ -874,9 +913,17 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $mainNodeCondition; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Creates an SQL part to match objects with a name starting with $filter | |
| + * | |
| + * If $filter is "others", the SQL part will match only names which do NOT start with a letter from the | |
| + * alphabet. | |
| + * | |
| + * @see eZAlphabetOperator::fetchAlphabet() | |
| + * | |
| + * @param string $filter | |
| + * @return string | |
| + */ | |
| static function createObjectNameFilterConditionSQLString( $filter ) | |
| { | |
| if ( !$filter ) | |
| @@ -897,10 +944,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $objectNameFilterSQL; | |
| } | |
| - | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Returns an array to filter a query by the given attributes in $attributeFilter | |
| + * | |
| + * @param array|bool $attributeFilter | |
| + * @param array $sortingInfo | |
| + * @param array|bool $language | |
| + * @return array|bool | |
| + */ | |
| static function createAttributeFilterSQLStrings( &$attributeFilter, &$sortingInfo = array( 'sortCount' => 0, 'attributeJoinCount' => 0 ), $language = false ) | |
| { | |
| // Check for attribute filtering | |
| @@ -1297,9 +1348,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $filterSQL; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Creates an SQL part to exclude the parent node from a query to fetch children of the node $nodeID, if needed | |
| + * | |
| + * @param int $nodeID | |
| + * @param int|bool $depth | |
| + * @param string $depthOperator | |
| + * @return string | |
| + */ | |
| static function createNotEqParentSQLString( $nodeID, $depth = false, $depthOperator = 'le' ) | |
| { | |
| $notEqParentString = ''; | |
| @@ -1311,9 +1367,15 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $notEqParentString; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Returns an SQL part which makes sure that fetched nodes are (not) part of the given node path | |
| + * | |
| + * @param string $nodePath | |
| + * @param int $nodeDepth | |
| + * @param bool $depth | |
| + * @param string $depthOperator | |
| + * @return string | |
| + */ | |
| static function createPathConditionSQLString( $nodePath, $nodeDepth, $depth = false, $depthOperator = 'le' ) | |
| { | |
| $pathCondition = ''; | |
| @@ -1354,9 +1416,17 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $pathCondition; | |
| } | |
| - /*! | |
| - \a static | |
| - */ | |
| + /** | |
| + * Returns an SQL part which makes sure that fetched nodes are (not) part of the given node path | |
| + * and not the parent node | |
| + * | |
| + * @param string $outPathConditionStr | |
| + * @param string $outNotEqParentStr | |
| + * @param int $nodeID | |
| + * @param bool $depth | |
| + * @param string $depthOperator | |
| + * @return bool | |
| + */ | |
| static function createPathConditionAndNotEqParentSQLStrings( &$outPathConditionStr, &$outNotEqParentStr, $nodeID, $depth = false, $depthOperator = 'le' ) | |
| { | |
| if ( !$depthOperator ) | |
| @@ -1828,9 +1898,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $limitationList; | |
| } | |
| - /*! | |
| - \sa subTree | |
| - */ | |
| + /** | |
| + * @param array|bool $params | |
| + * @param int $nodeID | |
| + * @return array|null | |
| + */ | |
| static function subTreeByNodeID( $params = false, $nodeID = 0 ) | |
| { | |
| if ( !is_numeric( $nodeID ) and !is_array( $nodeID ) ) | |
| @@ -2007,6 +2079,10 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $retNodeList; | |
| } | |
| + /** | |
| + * @param array|bool $params | |
| + * @return array|null | |
| + */ | |
| function subTree( $params = false ) | |
| { | |
| return eZContentObjectTreeNode::subTreeByNodeID( $params, $this->attribute( 'node_id' ) ); | |
| @@ -2058,7 +2134,6 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| 'SortBy' => false, | |
| 'Offset' => false, | |
| 'Limit' => false, | |
| - 'SortBy' => false, | |
| 'GroupBy' => false ); | |
| } | |
| @@ -2574,9 +2649,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| ); | |
| } | |
| - /*! | |
| - Returns the first level children in sorted order. | |
| - */ | |
| + /** | |
| + * Returns the first level children in sorted order. | |
| + * | |
| + * @return array|null | |
| + */ | |
| function children() | |
| { | |
| return $this->subTree( array( 'Depth' => 1, | |
| @@ -2948,10 +3025,10 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| /** | |
| * Fetches a node by ID | |
| * | |
| - * @param int|array $nodeID Either a node ID or array of node IDs | |
| - * @param string $lang language code to fetch the node in. If not provided, the prioritized language list is used | |
| + * @param int|array|bool $nodeID Either a node ID or array of node IDs | |
| + * @param string|bool $lang language code to fetch the node in. If not provided, the prioritized language list is used | |
| * @param bool $asObject True to fetch the node as an eZContentObjectTreeNode, false to fetch its attributes as an array | |
| - * @param array $conditions An associative array (field => value) of fetch conditions. Will be applied as is to the SQL query | |
| + * @param array|bool $conditions An associative array (field => value) of fetch conditions. Will be applied as is to the SQL query | |
| * | |
| * @return eZContentObjectTreeNode | |
| */ | |
| @@ -4064,9 +4141,12 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| } | |
| } | |
| - /*! | |
| - \return The number of nodes in the current subtree that have no other placements. | |
| - */ | |
| + /** | |
| + * Returns the number of nodes in the current subtree that have no other placements. | |
| + * | |
| + * @param array $params | |
| + * @return int | |
| + */ | |
| function subtreeSoleNodeCount( $params = array() ) | |
| { | |
| $nodeID = $this->attribute( 'node_id' ); | |
| @@ -5621,6 +5701,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| $db->commit(); | |
| } | |
| + /** | |
| + * Returns the eZContentObject associated to this node | |
| + * | |
| + * @return eZContentObject | |
| + */ | |
| function object() | |
| { | |
| if ( $this->hasContentObject() ) | |
| @@ -5634,6 +5719,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $obj; | |
| } | |
| + /** | |
| + * Checks if the node's contentobject has already loaded | |
| + * | |
| + * @return bool | |
| + */ | |
| function hasContentObject() | |
| { | |
| if ( isset( $this->ContentObject ) && $this->ContentObject instanceof eZContentObject ) | |
| @@ -5642,17 +5732,21 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return false; | |
| } | |
| - /*! | |
| - Sets the current content object for this node. | |
| - */ | |
| + /** | |
| + * Sets the current content object for this node. | |
| + * | |
| + * @param eZContentObject $object | |
| + */ | |
| function setContentObject( $object ) | |
| { | |
| $this->ContentObject = $object; | |
| } | |
| - /*! | |
| - \return the creator of the version published in the node. | |
| - */ | |
| + /** | |
| + * Returns the creator of the version published in the node. | |
| + * | |
| + * @return eZContentObject | |
| + */ | |
| function creator() | |
| { | |
| $db = eZDB::instance(); | |
| @@ -5666,6 +5760,12 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return eZContentObject::fetch( $creatorArray[0]['creator_id'] ); | |
| } | |
| + /** | |
| + * Returns the eZContentObjectVersionObject of the current node | |
| + * | |
| + * @param bool $asObject | |
| + * @return eZContentObjectVersion|array|bool | |
| + */ | |
| function contentObjectVersionObject( $asObject = true ) | |
| { | |
| $version = eZContentObjectVersion::fetchVersion( $this->ContentObjectVersion, $this->ContentObjectID, $asObject ); | |
| @@ -5676,6 +5776,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $version; | |
| } | |
| + /** | |
| + * Returns the node's url alias | |
| + * | |
| + * @return string | |
| + */ | |
| function urlAlias() | |
| { | |
| $useURLAlias =& $GLOBALS['eZContentObjectTreeNodeUseURLAlias']; | |
| @@ -5713,6 +5818,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $cleanURL; | |
| } | |
| + /** | |
| + * Returns the node's full url (/content/view/full/...) | |
| + * | |
| + * @return string | |
| + */ | |
| function url() | |
| { | |
| $ini = eZINI::instance(); | |
| @@ -5723,10 +5833,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return 'content/view/full/' . $this->NodeID; | |
| } | |
| - | |
| - /*! | |
| - \return the cached value of the class identifier if it exists, if not it's fetched dynamically | |
| - */ | |
| + /** | |
| + * Returns the node's class identifier | |
| + * | |
| + * @return string|bool|string|null | |
| + */ | |
| public function classIdentifier() | |
| { | |
| if ( $this->ClassIdentifier === null ) | |
| @@ -5738,9 +5849,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $this->ClassIdentifier; | |
| } | |
| - /*! | |
| - \return the cached value of the class name if it exists, if not it's fetched dynamically | |
| - */ | |
| + /** | |
| + * Returns the node's class name | |
| + * | |
| + * @return string|null | |
| + */ | |
| public function className() | |
| { | |
| if ( $this->ClassName === null ) | |
| @@ -5753,9 +5866,11 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $this->ClassName; | |
| } | |
| - /*! | |
| - \return the cached value of the class is_container flag if it exists, if not it's fetched dynamically | |
| - */ | |
| + /** | |
| + * Returns 1 if the node's class is a container class, 0 otherwise | |
| + * | |
| + * @return int|null | |
| + */ | |
| public function classIsContainer() | |
| { | |
| if ( $this->ClassIsContainer === null ) | |
| @@ -5767,20 +5882,23 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $this->ClassIsContainer; | |
| } | |
| - /*! | |
| - \return combined string representation of both "is_hidden" and "is_invisible" attributes | |
| - Used in the node view templates. | |
| - FIXME: this method probably should be removed in the future. | |
| - */ | |
| + /** | |
| + * Returns combined string representation of both "is_hidden" and "is_invisible" attributes | |
| + * | |
| + * @todo This method probably should be removed in the future. | |
| + * @return string | |
| + */ | |
| function hiddenInvisibleString() | |
| { | |
| return ( $this->IsHidden ? 'H' : '-' ) . '/' . ( $this->IsInvisible ? 'X' : '-' ); | |
| } | |
| - /*! | |
| - \return combined string representation of both "is_hidden" and "is_invisible" attributes | |
| - Used in the limitation handling templates. | |
| - */ | |
| + /** | |
| + * Returns combined string representation of both "is_hidden" and "is_invisible" attributes | |
| + * Used in the limitation handling templates. | |
| + * | |
| + * @return string | |
| + */ | |
| function hiddenStatusString() | |
| { | |
| if( $this->IsHidden ) | |
| @@ -5794,30 +5912,30 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return ezpI18n::tr( 'kernel/content', 'Visible' ); | |
| } | |
| - /*! | |
| - \a static | |
| - | |
| - \param $node Root node of the subtree | |
| - \param $modifyRootNode Whether to modify the root node (true/false) | |
| - | |
| - Hide algorithm: | |
| - if ( root node of the subtree is visible ) | |
| - { | |
| - 1) Mark root node as hidden and invisible | |
| - 2) Recursively mark child nodes as invisible except for ones which have been previously marked as invisible | |
| - } | |
| - else | |
| - { | |
| - Mark root node as hidden | |
| - } | |
| - | |
| - In some cases we don't want to touch the root node when (un)hiding a subtree, for example | |
| - after content/move or content/copy. | |
| - That's why $modifyRootNode argument is used. | |
| - | |
| - \note Transaction unsafe. If you call several transaction unsafe methods you must enclose | |
| - the calls within a db transaction; thus within db->begin and db->commit. | |
| - */ | |
| + /** | |
| + * Hide a subtree | |
| + * | |
| + * Hide algorithm: | |
| + * if ( root node of the subtree is visible ) | |
| + * { | |
| + * 1) Mark root node as hidden and invisible | |
| + * 2) Recursively mark child nodes as invisible except for ones which have been previously marked as invisible | |
| + * } | |
| + * else | |
| + * { | |
| + * Mark root node as hidden | |
| + * } | |
| + * | |
| + * In some cases we don't want to touch the root node when (un)hiding a subtree, for example | |
| + * after content/move or content/copy. | |
| + * That's why $modifyRootNode argument is used. | |
| + * | |
| + * Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within | |
| + * a db transaction; thus within db->begin and db->commit. | |
| + * | |
| + * @param eZContentObjectTreeNode $node Root node of the subtree | |
| + * @param bool $modifyRootNode Whether to modify the root node (true/false) | |
| + */ | |
| static function hideSubTree( eZContentObjectTreeNode $node, $modifyRootNode = true ) | |
| { | |
| $nodeID = $node->attribute( 'node_id' ); | |
| @@ -5862,26 +5980,26 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| eZContentObjectTreeNode::clearViewCacheForSubtree( $node, $modifyRootNode ); | |
| } | |
| - /*! | |
| - \a static | |
| - | |
| - \param $node Root node of the subtree | |
| - \param $modifyRootNode Whether to modify the root node (true/false) | |
| - | |
| - Unhide algorithm: | |
| - if ( parent node is visible ) | |
| - { | |
| - 1) Mark root node as not hidden and visible. | |
| - 2) Recursively mark child nodes as visible (except for nodes previosly marked as hidden, and all their children). | |
| - } | |
| - else | |
| - { | |
| - Mark root node as not hidden. | |
| - } | |
| - | |
| - \note Transaction unsafe. If you call several transaction unsafe methods you must enclose | |
| - the calls within a db transaction; thus within db->begin and db->commit. | |
| - */ | |
| + /** | |
| + * Unhide a subtree | |
| + * | |
| + * Unhide algorithm: | |
| + * if ( parent node is visible ) | |
| + * { | |
| + * 1) Mark root node as not hidden and visible. | |
| + * 2) Recursively mark child nodes as visible (except for nodes previosly marked as hidden, and all their children). | |
| + * } | |
| + * else | |
| + * { | |
| + * Mark root node as not hidden. | |
| + * } | |
| + * | |
| + * Transaction unsafe. If you call several transaction unsafe methods you must enclose | |
| + * the calls within a db transaction; thus within db->begin and db->commit. | |
| + * | |
| + * @param eZContentObjectTreeNode $node Root node of the subtree | |
| + * @param bool $modifyRootNode Whether to modify the root node (true/false) | |
| + */ | |
| static function unhideSubTree( eZContentObjectTreeNode $node, $modifyRootNode = true ) | |
| { | |
| $nodeID = $node->attribute( 'node_id' ); | |
| @@ -5890,7 +6008,7 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| $parentNode = $node->attribute( 'parent' ); | |
| if ( !$parentNode instanceof eZContentObjectTreeNode ) | |
| { | |
| - eZDebug::writeError( "Parent of Node #$nodeId doesn't exist or inaccesible.", __METHOD__ ); | |
| + eZDebug::writeError( "Parent of Node #$nodeID doesn't exist or inaccesible.", __METHOD__ ); | |
| return; | |
| } | |
| @@ -5945,11 +6063,14 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| eZContentObjectTreeNode::clearViewCacheForSubtree( $node, $modifyRootNode ); | |
| } | |
| - /*! | |
| - \a static | |
| - Depending on the new parent node visibility, recompute "is_invisible" attribute for the given node and its children. | |
| - (used after content/move or content/copy) | |
| - */ | |
| + /** | |
| + * Depending on the new parent node visibility, recompute "is_invisible" attribute for the given node and | |
| + * its children. (used after content/move or content/copy) | |
| + * | |
| + * @param eZContentObjectTreeNode $node | |
| + * @param eZContentObjectTreeNode $parentNode | |
| + * @param bool $recursive | |
| + */ | |
| static function updateNodeVisibility( $node, $parentNode, $recursive = true ) | |
| { | |
| if ( !$node ) | |
| @@ -5985,10 +6106,13 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| } | |
| } | |
| - /*! | |
| - \a static | |
| - \return true on success, false otherwise | |
| - */ | |
| + /** | |
| + * Clears the view cache for a subtree | |
| + * | |
| + * @param eZContentObjectTreeNode $node | |
| + * @param bool $clearForRootNode | |
| + * @return bool | |
| + */ | |
| static function clearViewCacheForSubtree( eZContentObjectTreeNode $node, $clearForRootNode = true ) | |
| { | |
| // Max nodes to fetch at a time | |
| @@ -6027,17 +6151,33 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return true; | |
| } | |
| + /** | |
| + * Given an $objectID, sets the node's object to the version specified by $newVersion | |
| + * | |
| + * @param int $objectID | |
| + * @param int $newVersion | |
| + */ | |
| static function setVersionByObjectID( $objectID, $newVersion ) | |
| { | |
| $db = eZDB::instance(); | |
| $db->query( "UPDATE ezcontentobject_tree SET contentobject_version='$newVersion' WHERE contentobject_id='$objectID'" ); | |
| } | |
| + /** | |
| + * Returns the node's current language | |
| + * | |
| + * @return string | |
| + */ | |
| function currentLanguage() | |
| { | |
| return $this->CurrentLanguage; | |
| } | |
| + /** | |
| + * Sets the current node's language to $languageCode | |
| + * | |
| + * @param string $languageCode | |
| + */ | |
| function setCurrentLanguage( $languageCode ) | |
| { | |
| $this->CurrentLanguage = $languageCode; | |
| @@ -6048,9 +6188,9 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| $this->Name = null; | |
| } | |
| - /*! | |
| - \static | |
| - */ | |
| + /** | |
| + * @return array | |
| + */ | |
| static function parentDepthLimitationList() | |
| { | |
| $maxLevel = 0; | |
| @@ -6067,19 +6207,24 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $depthArray; | |
| } | |
| - /* | |
| - Returns available classes as Js array. | |
| - Checks if the node is container, if yes emptyStr will be returned. | |
| - */ | |
| + /** | |
| + * Returns available classes as Js array. | |
| + * Checks if the node is container, if yes emptyStr will be returned. | |
| + * | |
| + * @return string | |
| + */ | |
| function availableClassesJsArray() | |
| { | |
| return eZContentObjectTreeNode::availableClassListJsArray( array( 'node' => $this ) ); | |
| } | |
| - /* | |
| - Returns available classes as Js array. | |
| - Checks for ini settings. | |
| - */ | |
| + /** | |
| + * Returns available classes as Js array. | |
| + * Checks for ini settings. | |
| + * | |
| + * @param array|bool $parameters | |
| + * @return string | |
| + */ | |
| static function availableClassListJsArray( $parameters = false ) | |
| { | |
| $iniMenu = eZINI::instance( 'contentstructuremenu.ini' ); | |
| @@ -6166,10 +6311,16 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return eZContentObjectTreeNode::getClassesJsArray( $node, $filterType == 'include', $groupIDs ); | |
| } | |
| - /* | |
| - Returns available classes as Js array. | |
| - \note building js array. | |
| - */ | |
| + /** | |
| + * Returns available classes as a JSON string | |
| + * | |
| + * @param eZContentObjectTreeNode|bool $node | |
| + * @param array|bool $includeFilter | |
| + * @param array|bool $groupList | |
| + * @param int|bool $fetchID | |
| + * @param array|bool $classes | |
| + * @return string | |
| + */ | |
| static function getClassesJsArray( $node = false, $includeFilter = true, $groupList = false, $fetchID = false, $classes = false ) | |
| { | |
| $falseValue = "''"; | |
| @@ -6210,16 +6361,29 @@ class eZContentObjectTreeNode extends eZPersistentObject | |
| return $falseValue; | |
| } | |
| - | |
| - /// The current language for the node | |
| + /** | |
| + * @var string|bool The current language for the node | |
| + */ | |
| public $CurrentLanguage = false; | |
| - /// Name of the node | |
| + /** | |
| + * @var string The name of the curent node | |
| + */ | |
| public $Name; | |
| - /// Contains the cached value of the class identifier | |
| + /** | |
| + * @var string|null The class identifier of the current node | |
| + */ | |
| public $ClassIdentifier = null; | |
| + | |
| + /** | |
| + * @var string|null The class name of the current node | |
| + */ | |
| public $ClassName = null; | |
| + | |
| + /** | |
| + * @var int|null Whether the node's class is a container (1) or not (0) | |
| + */ | |
| protected $ClassIsContainer = null; | |
| } | |
| diff --git a/kernel/classes/ezdatatype.php b/kernel/classes/ezdatatype.php | |
| index 55418df..7193a55 100644 | |
| --- a/kernel/classes/ezdatatype.php | |
| +++ b/kernel/classes/ezdatatype.php | |
| @@ -1235,6 +1235,16 @@ class eZDataType | |
| return false; | |
| } | |
| + /** | |
| + * Returns allowed datatypes | |
| + * | |
| + * Since 5.2 datatypes can be defined with a pair of | |
| + * dataype/class | |
| + * For keeping backward compability, allowedTypes will be | |
| + * filled with 'key' or 'val', depending on is_numeric( key ) value | |
| + * | |
| + * @return array | |
| + */ | |
| static function allowedTypes() | |
| { | |
| $allowedTypes =& $GLOBALS["eZDataTypeAllowedTypes"]; | |
| @@ -1242,7 +1252,11 @@ class eZDataType | |
| { | |
| $contentINI = eZINI::instance( 'content.ini' ); | |
| $dataTypes = $contentINI->variable( 'DataTypeSettings', 'AvailableDataTypes' ); | |
| - $allowedTypes = array_unique( $dataTypes ); | |
| + $allowedTypes = array(); | |
| + foreach ( $dataTypes as $key => $val ) | |
| + { | |
| + $allowedTypes[] = is_numeric( $key ) ? $val : $key; | |
| + } | |
| } | |
| return $allowedTypes; | |
| } | |
| @@ -1250,12 +1264,31 @@ class eZDataType | |
| static function loadAndRegisterAllTypes() | |
| { | |
| $allowedTypes = eZDataType::allowedTypes(); | |
| - foreach( $allowedTypes as $type ) | |
| + foreach ( $allowedTypes as $type ) | |
| { | |
| eZDataType::loadAndRegisterType( $type ); | |
| } | |
| } | |
| + /** | |
| + * Load and register the datatype $type | |
| + * | |
| + * Since 5.2 there is no need to do file_exists and include calls | |
| + * if datatype is defined in the following way: | |
| + * AvailableDataTypes[{$type}]={$class} | |
| + * Ex: AvailableDataTypes[custom]=customType | |
| + * | |
| + * It's still possible to define datatypes in the old way, so BC | |
| + * shouldn't be a problem for this case | |
| + * Ex: AvailableDataTypes[]=custom | |
| + * In this case, you'll need to call eZDataType::register | |
| + * from your custom class. | |
| + * | |
| + * Recommendation is moving to the new way. | |
| + * | |
| + * @param string $type | |
| + * @return bool | |
| + */ | |
| static function loadAndRegisterType( $type ) | |
| { | |
| $types =& $GLOBALS["eZDataTypes"]; | |
| @@ -1264,9 +1297,20 @@ class eZDataType | |
| return false; | |
| } | |
| - $baseDirectory = eZExtension::baseDirectory(); | |
| $contentINI = eZINI::instance( 'content.ini' ); | |
| - | |
| + $availableDataTypes = $contentINI->variable( 'DataTypeSettings', 'AvailableDataTypes' ); | |
| + if ( array_key_exists( $type, $availableDataTypes ) ) | |
| + { | |
| + if ( class_exists( $availableDataTypes[$type] ) ) | |
| + { | |
| + self::register( $type, $availableDataTypes[$type] ); | |
| + return true; | |
| + } | |
| + eZDebug::writeError( "Undefined datatype class: " . $availableDataTypes[$type], __METHOD__ ); | |
| + } | |
| + | |
| + $baseDirectory = eZExtension::baseDirectory(); | |
| + | |
| $extensionDirectories = $contentINI->variable( 'DataTypeSettings', 'ExtensionDirectories' ); | |
| $extensionDirectories = array_unique( $extensionDirectories ); | |
| $repositoryDirectories = $contentINI->variable( 'DataTypeSettings', 'RepositoryDirectories' ); | |
| diff --git a/kernel/classes/ezworkflowtype.php b/kernel/classes/ezworkflowtype.php | |
| index e3bf0e3..e7b3e17 100644 | |
| --- a/kernel/classes/ezworkflowtype.php | |
| +++ b/kernel/classes/ezworkflowtype.php | |
| @@ -118,6 +118,16 @@ class eZWorkflowType | |
| return $GLOBALS["eZWorkflowTypeObjects"]; | |
| } | |
| + /** | |
| + * Returns allowed eventypes | |
| + * | |
| + * Since 5.2 eventtypes can be defined with a pair of | |
| + * eventtype/class | |
| + * For keeping backward compability, allowedTypes will be | |
| + * filled with 'key' or 'val', depending on is_numeric( key ) value | |
| + * | |
| + * @return array | |
| + */ | |
| static function allowedTypes() | |
| { | |
| if ( !isset( $GLOBALS["eZWorkflowAllowedTypes"] ) || | |
| @@ -125,7 +135,11 @@ class eZWorkflowType | |
| { | |
| $wfINI = eZINI::instance( 'workflow.ini' ); | |
| $eventTypes = $wfINI->variable( "EventSettings", "AvailableEventTypes" ); | |
| - $GLOBALS["eZWorkflowAllowedTypes"] = array_unique( $eventTypes ); | |
| + $GLOBALS["eZWorkflowAllowedTypes"] = array(); | |
| + foreach ( $eventTypes as $key => $val ) | |
| + { | |
| + $GLOBALS["eZWorkflowAllowedTypes"][] = is_numeric( $key ) ? $val : $key; | |
| + } | |
| } | |
| return $GLOBALS["eZWorkflowAllowedTypes"]; | |
| } | |
| @@ -133,7 +147,7 @@ class eZWorkflowType | |
| static function loadAndRegisterAllTypes() | |
| { | |
| $allowedTypes = eZWorkflowType::allowedTypes(); | |
| - foreach( $allowedTypes as $type ) | |
| + foreach ( $allowedTypes as $type ) | |
| { | |
| eZWorkflowType::loadAndRegisterType( $type ); | |
| } | |
| @@ -156,6 +170,26 @@ class eZWorkflowType | |
| } | |
| } | |
| + /** | |
| + * Load and register the eventtype $type | |
| + * | |
| + * Since 5.2 there is no need to do file_exists and include calls | |
| + * if eventtype is defined in the following way: | |
| + * AvailableEventTypes[{$type}]={$class} | |
| + * Ex: AvailableEventTypes[event_custom]=eventCustomType | |
| + * | |
| + * It's still possible to define eventtyypes in the old way, so BC | |
| + * shouldn't be a problem for this case | |
| + * Ex: AvailableEventTypes[]=event_custom | |
| + * In this case, you'll need to call | |
| + * eZWorkflowEventType::registerEventType | |
| + * from your custom class. | |
| + * | |
| + * Recommendation is moving to the new way. | |
| + * | |
| + * @param string $typeString | |
| + * @return bool | |
| + */ | |
| static function loadAndRegisterType( $typeString ) | |
| { | |
| $typeElements = explode( "_", $typeString ); | |
| @@ -176,8 +210,21 @@ class eZWorkflowType | |
| $group = $typeElements[0]; | |
| $type = $typeElements[1]; | |
| - $baseDirectory = eZExtension::baseDirectory(); | |
| $wfINI = eZINI::instance( 'workflow.ini' ); | |
| + $availableEventTypes = $wfINI->variable( 'EventSettings', 'AvailableEventTypes' ); | |
| + if ( array_key_exists( $typeString, $availableEventTypes ) ) | |
| + { | |
| + if ( class_exists( $availableEventTypes[$typeString] ) ) | |
| + { | |
| + eZWorkflowEventType::registerEventType( $type, $availableEventTypes[$typeString] ); | |
| + return true; | |
| + } | |
| + else | |
| + eZDebug::writeError( "Undefined datatype class: " . $availableEventTypes[$typeString], __METHOD__ ); | |
| + } | |
| + | |
| + $baseDirectory = eZExtension::baseDirectory(); | |
| + | |
| $repositoryDirectories = $wfINI->variable( 'EventSettings', 'RepositoryDirectories' ); | |
| $extensionDirectories = $wfINI->variable( 'EventSettings', 'ExtensionDirectories' ); | |
| foreach ( $extensionDirectories as $extensionDirectory ) | |
| diff --git a/kernel/classes/workflowtypes/event/ezapprove/ezapprovetype.php b/kernel/classes/workflowtypes/event/ezapprove/ezapprovetype.php | |
| index 9944ee1..a2e8a91 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezapprove/ezapprovetype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezapprove/ezapprovetype.php | |
| @@ -761,6 +761,4 @@ class eZApproveType extends eZWorkflowEventType | |
| } | |
| } | |
| -eZWorkflowEventType::registerEventType( eZApproveType::WORKFLOW_TYPE_STRING, "eZApproveType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/workflowtypes/event/ezfinishuserregister/ezfinishuserregistertype.php b/kernel/classes/workflowtypes/event/ezfinishuserregister/ezfinishuserregistertype.php | |
| index bb2a51f..ecff68f 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezfinishuserregister/ezfinishuserregistertype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezfinishuserregister/ezfinishuserregistertype.php | |
| @@ -64,5 +64,4 @@ class eZFinishUserRegisterType extends eZWorkflowEventType { | |
| } | |
| -eZWorkflowEventType::registerEventType( eZFinishUserRegisterType::WORKFLOW_TYPE_STRING, "eZFinishUserRegisterType" ); | |
| ?> | |
| diff --git a/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php b/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php | |
| index 0b4494b..334eae6 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezmultiplexer/ezmultiplexertype.php | |
| @@ -422,6 +422,4 @@ class eZMultiplexerType extends eZWorkflowEventType | |
| } | |
| } | |
| -eZWorkflowEventType::registerEventType( eZMultiplexerType::WORKFLOW_TYPE_STRING, 'eZMultiplexerType' ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php b/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php | |
| index d7f7c93..889d41f 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php | |
| @@ -379,5 +379,4 @@ class eZPaymentGatewayType extends eZWorkflowEventType | |
| public $logger; | |
| } | |
| -eZWorkflowEventType::registerEventType( eZPaymentGatewayType::WORKFLOW_TYPE_STRING, 'ezpaymentgatewaytype' ); | |
| ?> | |
| diff --git a/kernel/classes/workflowtypes/event/ezsimpleshipping/ezsimpleshippingtype.php b/kernel/classes/workflowtypes/event/ezsimpleshipping/ezsimpleshippingtype.php | |
| index b2ae433..020e1e4 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezsimpleshipping/ezsimpleshippingtype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezsimpleshipping/ezsimpleshippingtype.php | |
| @@ -69,6 +69,4 @@ class eZSimpleShippingType extends eZWorkflowEventType | |
| } | |
| } | |
| -eZWorkflowEventType::registerEventType( eZSimpleShippingType::WORKFLOW_TYPE_STRING, "eZSimpleShippingType" ); | |
| - | |
| ?> | |
| diff --git a/kernel/classes/workflowtypes/event/ezwaituntildate/ezwaituntildatetype.php b/kernel/classes/workflowtypes/event/ezwaituntildate/ezwaituntildatetype.php | |
| index 1f880e0..b19293e 100644 | |
| --- a/kernel/classes/workflowtypes/event/ezwaituntildate/ezwaituntildatetype.php | |
| +++ b/kernel/classes/workflowtypes/event/ezwaituntildate/ezwaituntildatetype.php | |
| @@ -218,7 +218,4 @@ class eZWaitUntilDateType extends eZWorkflowEventType | |
| } | |
| -eZWorkflowEventType::registerEventType( eZWaitUntilDateType::WORKFLOW_TYPE_STRING, "eZWaitUntilDateType" ); | |
| - | |
| - | |
| ?> | |
| diff --git a/kernel/common/ezurloperator.php b/kernel/common/ezurloperator.php | |
| index afa1c96..e808bdd 100644 | |
| --- a/kernel/common/ezurloperator.php | |
| +++ b/kernel/common/ezurloperator.php | |
| @@ -383,7 +383,15 @@ CODEPIECE; | |
| { | |
| $sysAttribute = eZTemplateNodeTool::elementConstantValue( $parameters[1] ); | |
| - return array( eZTemplateNodeTool::createStringElement( $this->Sys->attribute( $sysAttribute ) ) ); | |
| + switch ( $sysAttribute ) | |
| + { | |
| + // Query string must be evaluated at runtime. See https://jira.ez.no/browse/EZP-20874 | |
| + case 'querystring': | |
| + case 'hostname': | |
| + return false; | |
| + default: | |
| + return array( eZTemplateNodeTool::createStringElement( $this->Sys->attribute( $sysAttribute ) ) ); | |
| + } | |
| } | |
| return false; | |
| } break; | |
| @@ -805,8 +813,17 @@ CODEPIECE; | |
| } break; | |
| case eZURLOperator::HTTP_OPERATOR_TYPE_SESSION: | |
| { | |
| - if ( $http->hasSessionVariable( $httpName ) ) | |
| + $hasSessionVariable = $http->hasSessionVariable( $httpName, false ); | |
| + // if null, session has not started, useful if using lazy loading | |
| + if ( $hasSessionVariable === null ) | |
| + { | |
| + $operatorValue = null; | |
| + return; | |
| + } | |
| + else if ( $hasSessionVariable !== false ) | |
| + { | |
| $operatorValue = !$checkExistence ? $http->sessionVariable( $httpName ) : true; | |
| + } | |
| else | |
| { | |
| if ( $checkExistence ) | |
| diff --git a/kernel/content/download.php b/kernel/content/download.php | |
| index 057acde..6658111 100644 | |
| --- a/kernel/content/download.php | |
| +++ b/kernel/content/download.php | |
| @@ -70,6 +70,11 @@ if ( $version != $currentVersion || $isContentDraft ) | |
| return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' ); | |
| } | |
| +ezpEvent::getInstance()->notify( | |
| + 'content/download', | |
| + array( 'contentObjectID' => $contentObjectID, | |
| + 'contentObjectAttributeID' => $contentObjectAttributeID ) ); | |
| + | |
| $fileHandler = eZBinaryFileHandler::instance(); | |
| $result = $fileHandler->handleDownload( $contentObject, $contentObjectAttribute, eZBinaryFileHandler::TYPE_FILE ); | |
| diff --git a/kernel/content/edit.php b/kernel/content/edit.php | |
| index 6b95ad2..0c61461 100644 | |
| --- a/kernel/content/edit.php | |
| +++ b/kernel/content/edit.php | |
| @@ -389,13 +389,16 @@ if ( !is_numeric( $EditVersion ) ) | |
| } | |
| } | |
| + $section = eZSection::fetch( $obj->attribute( 'section_id' ) ); | |
| $tpl = eZTemplate::factory(); | |
| $res = eZTemplateDesignResource::instance(); | |
| $res->setKeys( array( array( 'object', $obj->attribute( 'id' ) ), | |
| array( 'remote_id', $obj->attribute( 'remote_id' ) ), | |
| array( 'class', $class->attribute( 'id' ) ), | |
| array( 'class_identifier', $class->attribute( 'identifier' ) ), | |
| - array( 'class_group', $class->attribute( 'match_ingroup_id_list' ) ) ) ); | |
| + array( 'class_group', $class->attribute( 'match_ingroup_id_list' ) ), | |
| + array( 'section', $obj->attribute( 'section_id' ) ), | |
| + array( 'section_identifier', $section->attribute( 'identifier' ) ) ) ); | |
| $tpl->setVariable( 'edit_language', $EditLanguage ); | |
| $tpl->setVariable( 'from_language', $FromLanguage ); | |
| @@ -406,7 +409,6 @@ if ( !is_numeric( $EditVersion ) ) | |
| $Result = array(); | |
| $Result['content'] = $tpl->fetch( 'design:content/edit_draft.tpl' ); | |
| - $section = eZSection::fetch( $obj->attribute( 'section_id' ) ); | |
| if ( $section ) | |
| { | |
| $Result['navigation_part'] = $section->attribute( 'navigation_part_identifier' ); | |
| @@ -432,13 +434,16 @@ if ( !is_numeric( $EditVersion ) ) | |
| } | |
| } | |
| + $section = eZSection::fetch( $obj->attribute( 'section_id' ) ); | |
| $tpl = eZTemplate::factory(); | |
| $res = eZTemplateDesignResource::instance(); | |
| $res->setKeys( array( array( 'object', $obj->attribute( 'id' ) ), | |
| array( 'remote_id', $obj->attribute( 'remote_id' ) ), | |
| array( 'class', $class->attribute( 'id' ) ), | |
| array( 'class_identifier', $class->attribute( 'identifier' ) ), | |
| - array( 'class_group', $class->attribute( 'match_ingroup_id_list' ) ) ) ); | |
| + array( 'class_group', $class->attribute( 'match_ingroup_id_list' ) ), | |
| + array( 'section', $obj->attribute( 'section_id' ) ), | |
| + array( 'section_identifier', $section->attribute( 'identifier' ) ) ) ); | |
| $tpl->setVariable( 'edit_language', $EditLanguage ); | |
| $tpl->setVariable( 'from_language', $FromLanguage ); | |
| @@ -449,7 +454,6 @@ if ( !is_numeric( $EditVersion ) ) | |
| $Result = array(); | |
| $Result['content'] = $tpl->fetch( 'design:content/edit_draft.tpl' ); | |
| - $section = eZSection::fetch( $obj->attribute( 'section_id' ) ); | |
| if ( $section ) | |
| { | |
| $Result['navigation_part'] = $section->attribute( 'navigation_part_identifier' ); | |
| diff --git a/kernel/content/ezcontentoperationcollection.php b/kernel/content/ezcontentoperationcollection.php | |
| index 60709e5..b1b67d4 100644 | |
| --- a/kernel/content/ezcontentoperationcollection.php | |
| +++ b/kernel/content/ezcontentoperationcollection.php | |
| @@ -1157,7 +1157,7 @@ class eZContentOperationCollection | |
| * | |
| * @param int $parentNodeID | |
| * @param array $priorityArray | |
| - * @param array $priorityArray | |
| + * @param array $priorityIDArray | |
| * | |
| * @return array An array with operation status, always true | |
| */ | |
| diff --git a/kernel/setup/steps/ezstep_create_sites.php b/kernel/setup/steps/ezstep_create_sites.php | |
| index 66f01ae..7e8fbd8 100644 | |
| --- a/kernel/setup/steps/ezstep_create_sites.php | |
| +++ b/kernel/setup/steps/ezstep_create_sites.php | |
| @@ -492,10 +492,15 @@ class eZStepCreateSites extends eZStepInstaller | |
| if ( $db->databaseName() == 'mysql' ) | |
| { | |
| - // We try to use InnoDB table type if it is available, else we use the default type. | |
| - $innoDBAvail = $db->arrayQuery( "SHOW VARIABLES LIKE 'have_innodb';" ); | |
| - if ( $innoDBAvail[0]['Value'] == 'YES' ) | |
| - $params['table_type'] = 'innodb'; | |
| + $engines = $db->arrayQuery( 'SHOW ENGINES' ); | |
| + foreach( $engines as $engine ) | |
| + { | |
| + if ( $engine['Engine'] == 'InnoDB' && in_array( $engine['Support'], array( 'YES', 'DEFAULT' ) ) ) | |
| + { | |
| + $params['table_type'] = 'innodb'; | |
| + break; | |
| + } | |
| + } | |
| } | |
| if ( !$dbSchema->insertSchema( $params ) ) | |
| diff --git a/kernel/sql/common/cleandata.sql b/kernel/sql/common/cleandata.sql | |
| index f96c622..c8c6dc3 100644 | |
| --- a/kernel/sql/common/cleandata.sql | |
| +++ b/kernel/sql/common/cleandata.sql | |
| @@ -36881,7 +36881,7 @@ INSERT INTO ezsite_data ( | |
| value | |
| ) VALUES ( | |
| 'ezpublish-version', | |
| - '5.1.0alpha1' | |
| + '5.2.0alpha1' | |
| ); | |
| INSERT INTO ezurl ( | |
| diff --git a/kernel/user/activate.php b/kernel/user/activate.php | |
| index ea6d5d5..57c7677 100644 | |
| --- a/kernel/user/activate.php | |
| +++ b/kernel/user/activate.php | |
| @@ -69,6 +69,7 @@ if ( $accountKey ) | |
| if ( $user === null ) | |
| return $Module->handleError( eZError::KERNEL_NOT_FOUND, 'kernel' ); | |
| + eZUser::updateLastVisit( $userID , true ); | |
| $user->loginCurrent(); | |
| } | |
| } | |
| diff --git a/kernel/user/login.php b/kernel/user/login.php | |
| index 080cd64..b977bd5 100644 | |
| --- a/kernel/user/login.php | |
| +++ b/kernel/user/login.php | |
| @@ -289,7 +289,7 @@ $tpl = eZTemplate::factory(); | |
| $tpl->setVariable( 'login', $userLogin, 'User' ); | |
| $tpl->setVariable( 'post_data', $postData, 'User' ); | |
| $tpl->setVariable( 'password', $userPassword, 'User' ); | |
| -$tpl->setVariable( 'redirect_uri', $userRedirectURI, 'User' ); | |
| +$tpl->setVariable( 'redirect_uri', $userRedirectURI . eZSys::queryString(), 'User' ); | |
| $tpl->setVariable( 'warning', array( 'bad_login' => $loginWarning ), 'User' ); | |
| $tpl->setVariable( 'site_access', array( 'allowed' => $siteAccessAllowed, | |
| diff --git a/lib/version.php b/lib/version.php | |
| index 724f44f..6901327 100644 | |
| --- a/lib/version.php | |
| +++ b/lib/version.php | |
| @@ -15,11 +15,11 @@ | |
| class eZPublishSDK | |
| { | |
| const VERSION_MAJOR = 5; | |
| - const VERSION_MINOR = 1; | |
| + const VERSION_MINOR = 2; | |
| const VERSION_RELEASE = 0; | |
| const VERSION_STATE = 'alpha1'; | |
| const VERSION_DEVELOPMENT = true; | |
| - const VERSION_ALIAS = '5.1'; | |
| + const VERSION_ALIAS = '5.2'; | |
| const EDITION = 'eZ Publish Community Project'; | |
| /*! | |
| diff --git a/settings/content.ini b/settings/content.ini | |
| index 89c890a..d67e901 100755 | |
| --- a/settings/content.ini | |
| +++ b/settings/content.ini | |
| @@ -71,41 +71,47 @@ RepositoryDirectories[]=kernel/classes/datatypes | |
| # get datatypes from the extension when it's turned on. | |
| ExtensionDirectories[] | |
| -AvailableDataTypes[]=ezstring | |
| -AvailableDataTypes[]=eztext | |
| -AvailableDataTypes[]=ezxmltext | |
| -AvailableDataTypes[]=ezdate | |
| -AvailableDataTypes[]=ezdatetime | |
| -AvailableDataTypes[]=eztime | |
| -AvailableDataTypes[]=ezboolean | |
| -AvailableDataTypes[]=ezinteger | |
| -AvailableDataTypes[]=ezfloat | |
| -AvailableDataTypes[]=ezenum | |
| -AvailableDataTypes[]=ezobjectrelation | |
| -AvailableDataTypes[]=ezobjectrelationlist | |
| -AvailableDataTypes[]=ezimage | |
| -AvailableDataTypes[]=ezbinaryfile | |
| -AvailableDataTypes[]=ezmedia | |
| -AvailableDataTypes[]=ezauthor | |
| -AvailableDataTypes[]=ezurl | |
| -AvailableDataTypes[]=ezemail | |
| -AvailableDataTypes[]=ezoption | |
| -AvailableDataTypes[]=ezmultioption | |
| -AvailableDataTypes[]=ezmultioption2 | |
| -AvailableDataTypes[]=ezrangeoption | |
| -AvailableDataTypes[]=ezprice | |
| -AvailableDataTypes[]=ezmultiprice | |
| -AvailableDataTypes[]=ezuser | |
| -AvailableDataTypes[]=ezisbn | |
| -AvailableDataTypes[]=ezkeyword | |
| -AvailableDataTypes[]=ezsubtreesubscription | |
| -AvailableDataTypes[]=ezmatrix | |
| -AvailableDataTypes[]=ezselection | |
| -AvailableDataTypes[]=ezidentifier | |
| -AvailableDataTypes[]=ezinisetting | |
| -AvailableDataTypes[]=ezpackage | |
| -AvailableDataTypes[]=ezproductcategory | |
| -AvailableDataTypes[]=ezcountry | |
| +# Since 5.2 AvailableDataTypes can be defined with a pair | |
| +# of dataype/class and so take adventage of autoload mechanism | |
| +# reducing the number of file_exists and include calls. | |
| +# The previous way is still valid: | |
| +# Ex. AvailableDataTypes[]=mytype | |
| +# but this new way is the recommended now. | |
| +AvailableDataTypes[ezstring]=eZStringType | |
| +AvailableDataTypes[eztext]=eZTextType | |
| +AvailableDataTypes[ezxmltext]=eZXMLTextType | |
| +AvailableDataTypes[ezdate]=eZDateType | |
| +AvailableDataTypes[ezdatetime]=eZDateTimeType | |
| +AvailableDataTypes[eztime]=eZTimeType | |
| +AvailableDataTypes[ezboolean]=eZBooleanType | |
| +AvailableDataTypes[ezinteger]=eZIntegerType | |
| +AvailableDataTypes[ezfloat]=eZFloatType | |
| +AvailableDataTypes[ezenum]=eZEnumType | |
| +AvailableDataTypes[ezobjectrelation]=eZObjectRelationType | |
| +AvailableDataTypes[ezobjectrelationlist]=eZObjectRelationListType | |
| +AvailableDataTypes[ezimage]=eZImageType | |
| +AvailableDataTypes[ezbinaryfile]=eZBinaryFileType | |
| +AvailableDataTypes[ezmedia]=eZMediaType | |
| +AvailableDataTypes[ezauthor]=eZAuthorType | |
| +AvailableDataTypes[ezurl]=eZURLType | |
| +AvailableDataTypes[ezemail]=eZEmailType | |
| +AvailableDataTypes[ezoption]=eZOptionType | |
| +AvailableDataTypes[ezmultioption]=eZMultiOptionType | |
| +AvailableDataTypes[ezmultioption2]=eZMultiOption2Type | |
| +AvailableDataTypes[ezrangeoption]=eZRangeOptionType | |
| +AvailableDataTypes[ezprice]=eZPriceType | |
| +AvailableDataTypes[ezmultiprice]=eZMultiPriceType | |
| +AvailableDataTypes[ezuser]=eZUserType | |
| +AvailableDataTypes[ezisbn]=eZISBNType | |
| +AvailableDataTypes[ezkeyword]=eZKeywordType | |
| +AvailableDataTypes[ezsubtreesubscription]=eZSubtreeSubscriptionType | |
| +AvailableDataTypes[ezmatrix]=eZMatrixType | |
| +AvailableDataTypes[ezselection]=eZSelectionType | |
| +AvailableDataTypes[ezidentifier]=eZIdentifierType | |
| +AvailableDataTypes[ezinisetting]=eZIniSettingType | |
| +AvailableDataTypes[ezpackage]=eZPackageType | |
| +AvailableDataTypes[ezproductcategory]=eZProductCategoryType | |
| +AvailableDataTypes[ezcountry]=eZCountryType | |
| # datatypes that hold user accounts | |
| # several actions on user account objects (removing, moving, etc.) | |
| diff --git a/settings/menu.ini b/settings/menu.ini | |
| index 87b0a1c..a09d354 100644 | |
| --- a/settings/menu.ini | |
| +++ b/settings/menu.ini | |
| @@ -270,6 +270,10 @@ Shown[browse]=true | |
| # value an be either in "<node_id>" or "<module>/<function>" form | |
| # Menu item is disabled (no link) if this returns false | |
| #PolicyList_<Links_index>[]=<value> | |
| +# Enabled sets if menuitem is clickable in current ui_context or value 'default' | |
| +# By default 'default' is considered true and 'edit' + 'browse' is false | |
| +#Enabled_<Links_index>[browse]=false | |
| + | |
| # Uncomment the following to add a left menu to content area | |
| diff --git a/settings/site.ini b/settings/site.ini | |
| index 1faf662..6e8c154 100644 | |
| --- a/settings/site.ini | |
| +++ b/settings/site.ini | |
| @@ -156,7 +156,7 @@ EmailReceiver= | |
| # Empty or 0 means this ability will be disabled and CookieTimeout will be used. | |
| RememberMeTimeout= | |
| -# eZ Publish session handler (class name) | |
| +# eZ Publish legacy session handler (class name) : not applicable if using the symfony stack | |
| # When empty uses ezpSessionHandlerPHP, a session handler that lets php remain in control | |
| # of the session handling (def: files, as defined by session.save_handler in php.ini) | |
| # To get back old behavior for logged in/anonymous count & session clearing, use ezpSessionHandlerDB | |
| @@ -171,7 +171,7 @@ SessionTimeout=259200 | |
| # Number of seconds before a session is considered inactive/logged out, 1 hour is standard | |
| ActivityTimeout=3600 | |
| -## Backward compatibility settings: | |
| +## Backward compatibility settings: not applicable if using the symfony stack | |
| # Makes session always start even if not needed (for anonymous users that just browse the site) | |
| # by default it will not start before it is used | |
| ForceStart=disabled | |
| diff --git a/settings/workflow.ini b/settings/workflow.ini | |
| index 6998609..e59d962 100644 | |
| --- a/settings/workflow.ini | |
| +++ b/settings/workflow.ini | |
| @@ -18,14 +18,20 @@ RepositoryDirectories[]=kernel/classes/workflowtypes | |
| # get workflow events from the extension when it's turned on. | |
| ExtensionDirectories[] | |
| -# A list of events, each entry consists of the group | |
| -# and the name with a _ as separator | |
| -AvailableEventTypes[]=event_ezapprove | |
| -AvailableEventTypes[]=event_ezwaituntildate | |
| -AvailableEventTypes[]=event_ezsimpleshipping | |
| -AvailableEventTypes[]=event_ezmultiplexer | |
| -AvailableEventTypes[]=event_ezpaymentgateway | |
| -AvailableEventTypes[]=event_ezfinishuserregister | |
| +# Since 5.2 AvailableEventTypes can be defined with a pair | |
| +# of eventtype/class and so take adventage of autoload mechanism | |
| +# reducing the number of file_exists and include calls. | |
| +# The previous way is still valid. | |
| +# Example. AvailableEventTypes[]=event_myevent | |
| +# A list of events, each key consists of the group | |
| +# and the name with a _ as separator. | |
| +# Entry is the class name | |
| +AvailableEventTypes[event_ezapprove]=eZApproveType | |
| +AvailableEventTypes[event_ezwaituntildate]=eZWaitUntilDateType | |
| +AvailableEventTypes[event_ezsimpleshipping]=eZSimpleShippingType | |
| +AvailableEventTypes[event_ezmultiplexer]=eZMultiplexerType | |
| +AvailableEventTypes[event_ezpaymentgateway]=eZPaymentGatewayType | |
| +AvailableEventTypes[event_ezfinishuserregister]=eZFinishUserRegisterType | |
| [OperationSettings] | |
| # List of available trigger operations. | |
| diff --git a/share/db_data.dba b/share/db_data.dba | |
| index e2972f0..805241c 100644 | |
| --- a/share/db_data.dba | |
| +++ b/share/db_data.dba | |
| @@ -21839,7 +21839,7 @@ keywords=cms, publish, e-commerce, content management, development framework', | |
| 1 => | |
| array ( | |
| 0 => 'ezpublish-version', | |
| - 1 => '5.1.0alpha1', | |
| + 1 => '5.2.0alpha1', | |
| ), | |
| ), | |
| ), | |
| diff --git a/support/ezlupdate-qt4.5/ezlupdate/main.cpp b/support/ezlupdate-qt4.5/ezlupdate/main.cpp | |
| index a5b1c51..e24232e 100644 | |
| --- a/support/ezlupdate-qt4.5/ezlupdate/main.cpp | |
| +++ b/support/ezlupdate-qt4.5/ezlupdate/main.cpp | |
| @@ -124,7 +124,7 @@ static void recursiveFileInfoList(const QDir &dir, | |
| } | |
| } | |
| -static QString version = "5.1.0alpha1"; // eZ Publish version plus local version | |
| +static QString version = "5.2.0alpha1"; // eZ Publish version plus local version | |
| static QStringList dirs; // Additional scan directories | |
| static QDir extension_dir; // Extension directory | |
| static QRegExp localeRE( "^[a-z]{3}-[A-Z]{2}(@.*)?$" ); | |
| diff --git a/tests/tests/kernel/classes/ezcontentobject_test.php b/tests/tests/kernel/classes/ezcontentobject_test.php | |
| index 39a3898..67010c4 100644 | |
| --- a/tests/tests/kernel/classes/ezcontentobject_test.php | |
| +++ b/tests/tests/kernel/classes/ezcontentobject_test.php | |
| @@ -207,6 +207,45 @@ class eZContentObjectTest extends ezpDatabaseTestCase | |
| } | |
| /** | |
| + * Unit test for eZContentObject::relatedObjects() | |
| + * | |
| + * Outline: | |
| + * 1) Create a content class with ezobjectrelation attribute | |
| + * 2) Create object of that class and relate to another object through the attribute | |
| + * 3) Check that object loaded by eZContentObject::relatedObjects() is the correct one | |
| + */ | |
| + public function testRelatedObjectsWithAttributeId() | |
| + { | |
| + // Create a test content class | |
| + $class = new ezpClass( __FUNCTION__, __FUNCTION__, 'name' ); | |
| + $class->add( 'Name', 'name', 'ezstring' ); | |
| + $attributeId = $class->add( 'Single relation #1', 'relation', 'ezobjectrelation' )->attribute( 'id' ); | |
| + $class->store(); | |
| + | |
| + // Create an article we will relate our object to | |
| + $article = new ezpObject( 'article', 2 ); | |
| + $article->title = "Related object #1 for " . __FUNCTION__; | |
| + $article->publish(); | |
| + | |
| + // Create a test object with attribute relation to created article | |
| + $object = new ezpObject( __FUNCTION__, 2 ); | |
| + $object->name = __FUNCTION__; | |
| + $object->relation = $article->attribute( 'id' ); | |
| + $object->publish(); | |
| + | |
| + $contentObject = eZContentObject::fetch( $object->attribute( 'id' ) ); | |
| + $relatedObjects = $contentObject->relatedObjects( false, false, $attributeId ); | |
| + | |
| + $this->assertCount( 1, $relatedObjects ); | |
| + $this->assertInstanceOf( "eZContentObject", $relatedObjects[0] ); | |
| + $this->assertEquals( | |
| + $article->attribute( 'id' ), | |
| + $relatedObjects[0]->attribute( "id" ), | |
| + "Related object is not the expected object" | |
| + ); | |
| + } | |
| + | |
| + /** | |
| * Unit test for {@link eZContentObject::fetchByNodeID()} | |
| */ | |
| public function testFetchByNodeIDAsObject() | |
| diff --git a/tests/tests/kernel/common/ezurloperator_test.php b/tests/tests/kernel/common/ezurloperator_test.php | |
| index a9f9df1..f66f0c8 100644 | |
| --- a/tests/tests/kernel/common/ezurloperator_test.php | |
| +++ b/tests/tests/kernel/common/ezurloperator_test.php | |
| @@ -55,7 +55,11 @@ class eZURLOperatorTest extends ezpTestCase | |
| case 'get' : $_GET[$argument] = $expectedResult; break; | |
| case 'post' : $_POST[$argument] = $expectedResult; break; | |
| case 'cookie' : $_COOKIE[$argument] = $expectedResult; break; | |
| - case 'session': $_SESSION[$argument] = $expectedResult; break; | |
| + case 'session': | |
| + $_SESSION[$argument] = $expectedResult; | |
| + // session is lazy loaded, expected result is null (session has not started) to be returned | |
| + $expectedResult = null; | |
| + break; | |
| } | |
| $operatorParameters = array( | |
| diff --git a/update/database/mysql/5.2/dbupdate-5.1.0-to-5.2.0.sql b/update/database/mysql/5.2/dbupdate-5.1.0-to-5.2.0.sql | |
| new file mode 100644 | |
| index 0000000..3eb3a11 | |
| --- /dev/null | |
| +++ b/update/database/mysql/5.2/dbupdate-5.1.0-to-5.2.0.sql | |
| @@ -0,0 +1,3 @@ | |
| +SET storage_engine=InnoDB; | |
| +UPDATE ezsite_data SET value='5.2.0alpha1' WHERE name='ezpublish-version'; | |
| +UPDATE ezsite_data SET value='1' WHERE name='ezpublish-release'; | |
| diff --git a/update/database/postgresql/5.2/dbupdate-5.1.0-to-5.2.0.sql b/update/database/postgresql/5.2/dbupdate-5.1.0-to-5.2.0.sql | |
| new file mode 100644 | |
| index 0000000..42f8d77 | |
| --- /dev/null | |
| +++ b/update/database/postgresql/5.2/dbupdate-5.1.0-to-5.2.0.sql | |
| @@ -0,0 +1,2 @@ | |
| +UPDATE ezsite_data SET value='5.2.0alpha1' WHERE name='ezpublish-version'; | |
| +UPDATE ezsite_data SET value='1' WHERE name='ezpublish-release'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment