Plain site and ezwebin

Author Message

Frederic GUEHO

Friday 15 June 2007 5:52:17 am

I'd like to install the ezwebin extension on a plain site installation.
I'd like to have the website toolbar in my plain site.

How can I do that ?

Thanks for your help.

laurent le cadet

Tuesday 26 June 2007 11:39:53 pm

Hi,

In ezwebin pagelayout, there is an include for the users toolbar :

{include uri='design:parts/editor_toolbar.tpl'}

the tempalte :

{def $current_node = fetch( 'content', 'node', hash( 'node_id', $module_result.node_id ) )
	 $content_object = $current_node.object
	 $can_edit_languages   = $content_object.can_edit_languages
     $can_create_languages = $content_object.can_create_languages
	 $available_for_classes = ezini( 'EditorToolbarSettings', 'AvailableForClasses', 'editortoolbar.ini' )
	 $containers = ezini( 'EditorToolbarSettings', 'Containers', 'editortoolbar.ini' )
	 $website_toolbar_access = fetch( 'content', 'object', hash( 'object_id', $current_user.groups[0] ) ).data_map.website_toolbar_access.data_int}

{if and( $current_user.is_logged_in, $website_toolbar_access, $available_for_classes|contains( $current_node.class_identifier ) )}

<div class="box-et {if eq( $current_node.class_identifier, 'frontpage' )}frontpage-et{/if}">
<div class="tl"><div class="tr"><div class="br"><div class="bl"><div class="box-content">


<div class="block">
<div class="left">
<form method="post" action={"content/action"|ezurl}>
<a href={"/ezinfo/about"|ezurl}><img src={"ez_toolbar.png"|ezimage} alt="eZ publish Now" width="49" height="16" /></a>
{if and( $content_object.can_create,$containers|contains( $current_node.class_identifier ) )}
  <select name="ClassID">
  {foreach $content_object.can_create_class_list as $class}
	<option value="{$class.id}">{$class.name|wash}</option>
  {/foreach}
  </select>
  <input type="hidden" name="ContentLanguageCode" value="{$content_object.initial_language_code}" />
  <input class="button" type="submit" name="NewButton" value="{'Create here'|i18n('design/standard/node/view')}" />
{/if}

{if $content_object.can_edit}
	<input type="hidden" name="ContentObjectLanguageCode" value="{ezini( 'RegionalSettings', 'Locale' , 'site.ini')}" />
  <input class="button" type="submit" name="EditButton" value="{'Edit'|i18n('design/standard/node/view')}" />
{/if}

{if $content_object.can_move}
  <input class="button" type="submit" name="MoveNodeButton" value="{'Move'|i18n('design/admin/node/view/full')}" />
{/if}

{if $content_object.can_remove}
   <input class="button" type="submit" name="ActionRemove" value="{'Remove'|i18n('design/standard/node/view')}" />
{/if}

  <input type="hidden" name="ContentObjectID" value="{$content_object.id}" />
  <input type="hidden" name="NodeID" value="{$current_node.node_id}" />
  <input type="hidden" name="ContentNodeID" value="{$current_node.node_id}" />
</form>
</div>

<div class="right">

{def $disable_oo=true()}

{if array( 'documentation_page', 'folder', 'article', 'event' )|contains( $current_node.class_identifier )}
	{set $disable_oo=false()}
{/if}

{if $disable_oo|not}
<img src={"oo_logo.gif"|ezimage} alt="OpenOffice Integration" width="49" height="18" />

{if and( $content_object.content_class.is_container, ne( $content_object.content_class.identifier, 'article' ) )}
{* Import OOo / OASIS document *}
<form method="post" action={"/odf/import/"|ezurl}>
  <input type="hidden" name="NodeID" value="{$current_node.node_id}" />
  <input type="hidden" name="ObjectID" value="{$content_object.id}" />
  <input class="button" type="submit" name="ImportAction" value="{'Import'|i18n('extension/ezodf')}" />
</form>
{/if}
<form method="post" action={"/odf/export/"|ezurl}>
  <input type="hidden" name="NodeID" value="{$current_node.node_id}" />
  <input type="hidden" name="ObjectID" value="{$content_object.id}" />
  <input class="button" type="submit" name="ExportAction" value="{'Export'|i18n('extension/ezodf')}" />
</form>
<form method="post" action={"/odf/import/"|ezurl}>
  <input type="hidden" name="ImportType" value="replace" />
  <input type="hidden" name="NodeID" value="{$current_node.node_id}" />
  <input type="hidden" name="ObjectID" value="{$content_object.id}" />
  <input class="button" type="submit" name="ReplaceAction" value="{'Replace'|i18n('extension/ezodf')}" />
</form>
{/if}

<a href="http://ez.no/doc" title="Documentation"><img src={"ezt_question_mark.gif"|ezimage} alt="Help" {if $disable_oo|not}class="oohelp"{else}class="help"{/if} /></a>

</div>
</div>

</div></div></div></div></div>
</div>

{/if}

It needs some settings as you can read above + a check box "website_toolbar_access" (attribute identifier) you'll have to add to your user group class to decide which user group will have rights to use this toolbar:

$website_toolbar_access = fetch( 'content', 'object', hash( 'object_id', $current_user.groups[0] ) ).data_map.website_toolbar_access.data_int}

It should be enough, more or less, but that's the way it works.

No need to install the complete ezwebin extension if you want to preserve your site design.

Regards.

Laurent

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:15:29
Script start
Timing: Jan 18 2025 15:15:29
Module start 'layout'
Timing: Jan 18 2025 15:15:29
Module start 'content'
Timing: Jan 18 2025 15:15:30
Module end 'content'
Timing: Jan 18 2025 15:15:30
Script end

Main resources:

Total runtime0.9896 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9141152.6250
Module start 'layout' 0.00560.0028 740.539139.4609
Module start 'content' 0.00850.9795 780.0000512.2813
Module end 'content' 0.98800.0016 1,292.281316.1719
Script end 0.9896  1,308.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3369160.0002
Check MTime0.00140.1383160.0001
Mysql Total
Database connection0.00070.073910.0007
Mysqli_queries0.947895.7739540.0176
Looping result0.00040.0445520.0000
Template Total0.960197.020.4801
Template load0.00210.211820.0010
Template processing0.958096.805620.4790
Template load and register function0.00010.014210.0001
states
state_id_array0.00100.096310.0010
state_identifier_array0.00110.106620.0005
Override
Cache load0.00170.1726200.0001
Sytem overhead
Fetch class attribute can translate value0.00050.053820.0003
Fetch class attribute name0.00090.086830.0003
XML
Image XML parsing0.00080.076720.0004
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00080.0845160.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs