Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: sections/section.php

Class Section extends Anchor - The implementation of anchor for sections

This class implements the Anchor interface for sections.

This script is a reference file of this system.

Voir aussi:

Licence: GNU Lesser General Public License

Auteurs:

get_bullet_url() - Get the url to display bullet images

function get_bullet_url()



Voir aussi:

get_focus() - Get the focus for this anchor

function get_focus()

This function lists containers of the content tree, from top level down to this item.

get_icon_url() - Get the url to display the icon for this anchor

function get_icon_url()



Voir aussi:

get_label() - Provide a custom label

function get_label($variant, $id, $title='')

get_neighbours() - Get next and previous items, if any

function get_neighbours($type, &$item)



Voir aussi:

get_path_bar() - Get the path bar for this anchor

function get_path_bar()

This function is used to build a path bar relative to the anchor. For example, if you are displaying an article related to a section, the path bar has to mention the section. You can use following code to do that:
$anchor get_anchor($article['anchor']);
$context['path_bar'] = array_merge($context['path_bar'], $anchor->get_path_bar());


This function uses the cache to save on database requests.

Voir aussi:

get_reference() - Get the reference for this anchor

function get_reference()

This function is used to retrieve a reference to be placed into the database. For example:
$anchor get_anchor($article['anchor']);
$context['text'] .= '<input type="hidden" name="anchor" value="'.$anchor->get_reference().'" />';


Voir aussi:

get_teaser() - Get some introductory text from a section

function &get_teaser($variant = 'basic')

This function is used to introduce comments, or any sub-item related to an anchor. Compared to the standard anchor implementation, this one adds the ability to handle overlay data.

If there is some introductory text, it is used. Else the description text is used instead. The number of words is capped in both cases.

Also, the number of remaining words is provided.

Following variants may be selected to adapt to various situations:

Voir aussi:

get_thumbnail_url() - Get the url to display the thumbnail for this anchor

function get_thumbnail_url()

A common concern of modern webmaster is to apply a reduced set of icons throughout all pages. This function is aiming to retrieve the small-size icon characterizing one anchor. It should be used in pages to display several images into lists of anchored items.

Note: This function returns a URL to the thumbnail that is created by default when an icon is set for the section. However, the webmaster can decide to NOT display section thumbnails throughout the server. In this case, he/she has just to suppress the thumbnail URL in each section and that's it.

Voir aussi:

get_url() - Get the url to display the main page for this anchor

function get_url($action='view')



Voir aussi:

get_user_profile() - Integrate a user profile, if applicable

function get_user_profile($user, $variant='prefix')

The process depends on following keywords being in the option field:

with_prefix_profile -- if the variant is 'prefix', returns a full description of the poster

with_suffix_profile -- if the variant is 'suffix', returns a textual description of the poster

with_extra_profile -- if the variant is 'extra', returns a full description of the poster in a sidebox

* Also, if the 'yabb' layout has been selected -- if the variant is 'prefix', displays an avatar for the user

Voir aussi:

has_option() - Check that an option has been set for this section

function has_option($option)

This function is used to control, from the anchor, the behaviour of linked items.

This function recursively invokes upstream anchors, if any. For example, if the option 'skin_boxes' is set at the section level, all articles, but also all attached files and images of these articles, will feature the skin 'boxes'.

is_editable() - Check that the surfer is an editor of an anchor

function is_editable($user_id=NULL)

This function is used to control the authority delegation from the anchor. For example, if some editor is assigned to a complete section of the web site, he/she should be able to edit all articles in this section. you can use following code to check that:
$anchor get_anchor($article['anchor']);
if(
$anchor->is_editable() {
 ...
}


A logged member is always considered as an editor if he has created the target item.

Compared to the original member function in shared/anchor.php, this one also checks rights of managing editors, and allows for anonymous changes.

is_public() - Determine if public access is allowed to the anchor

function is_public()

This function is used to enable additional processing steps on public pages only. For example, only public pages are pinged on publication.

Voir aussi:

is_viewable() - Check that the surfer is allowed to display the anchor

function is_viewable()

This function is used to control the authority delegation from the anchor.

load_by_id() - Load the related item

function load_by_id($id)

Voir aussi:

touch() - Remember the last action for this section

function touch($action, $origin, $silently = FALSE)



Voir aussi:

Tools
Browse the source of this script
Server software