\seekquarry\yioop\views\elementsWikiElement

Element responsible for drawing wiki pages in group view It is also responsible for rendering wiki history pages, and listings of wiki pages available for a group

Elements are classes are used to render portions of a web page which might be common to several views like a view there is supposed to minimal php code in an element

Summary

Methods
Properties
Constants
__construct()
render()
renderReadPage()
renderEditPageForm()
renderResources()
renderPath()
renderPages()
renderRelationships()
renderHistory()
renderSourcePage()
dynamicSubstitutions()
$view
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$view

$view : object

The View on which this Element is drawn

Type

object

Methods

__construct()

__construct(object  $view = null) 

constructor stores a reference to the view this element will reside on

Parameters

object $view

object this element will reside on

render()

render(array  $data) 

Draw a wiki page for group, or, depending on $data['MODE'] a listing of all pages for a group, or the history of revisions of a given page or the edit page form

It should be implemented in subclasses.

Parameters

array $data

fields contain data about the page being displayed or edited, or the list of pages being displayed.

renderReadPage()

renderReadPage(array  $data, boolean  $can_edit, boolean  $logged_in) 

Used to draw a Wiki Page for reading. If the page does not exist various create/login-to-create etc messages are displayed depending of it the user is logged in. and has write permissions on the group

Parameters

array $data

fields PAGE used for page contents

boolean $can_edit

whether the current user has permissions to edit or create this page

boolean $logged_in

whether current user is logged in or not

renderEditPageForm()

renderEditPageForm(array  $data) 

Used to drawn the form that let's someone edit a wiki page

Parameters

array $data

fields contain data about the page being edited. In particular, PAGE contains the raw page data

renderResources()

renderResources(array  $data, boolean  $read_mode, boolean  $logged_in = true) 

Draws a list of media resources associated with a wiki page

Parameters

array $data

fields RESOURCES_INFO contains info on resources

boolean $read_mode

whether the readering should be for a media list in read mode or for use on the edit task of any wiki page

boolean $logged_in

whether the user is currently logged in or not

renderPath()

renderPath(string  $dropdown_id, array  $data, array  $options, string  $selected_url = "", string  $top_name = "", string  $render_type = "paths", boolean  $as_list = false) 

Used to render the dropdown that lists paths within media lists folders, recent wiki pages, and groups a user has been to

Parameters

string $dropdown_id

element id of select tag to be used for dropdown

array $data

set up in controller and SocialComponent with data fields view and this element are supposed to render

array $options

if nonempty, then this should be items, key-values in the form (url => label), to list first in dropdown

string $selected_url

url which is selected by default in dropdown.

string $top_name

name of root media list folder (defaults to something like "Root Folder" in the language of current locale)

string $render_type

can be: "paths" if just listing folder path in wiki page resource folder, "just_groups_and_pages" if want a list of recent groups and wiki pages viewed, or "all" if want both

boolean $as_list

whether to output the result as a dropdown or as an unordered list.

renderPages()

renderPages(array  $data, boolean  $can_edit, boolean  $logged_in) 

Used to draw a list of Wiki Pages for the current group. It also draws a search form and can be used to create pages

Parameters

array $data

fields for the current controller, CSRF_TOKEN etc needed to render the search for and paging queries

boolean $can_edit

whether the current user has permissions to edit or create this page

boolean $logged_in

whethe current user is logged in or not

renderRelationships()

renderRelationships(array  $data) 

Used to draw the page which displays all wiki pages that link a wiki page with a particular relationship type

Parameters

array $data

fields contain info about all such wiki pages

renderHistory()

renderHistory(array  $data) 

Used to draw the revision history page for a wiki document Has a form that can be used to draw the diff of two revisions

Parameters

array $data

fields contain info about revisions of a Wiki page

renderSourcePage()

renderSourcePage(array  $data) 

Used to drawn the form that let's someone see the source of a wiki page

Parameters

array $data

fields contain data about the page being edited. In particular, PAGE contains the raw page data

dynamicSubstitutions()

dynamicSubstitutions(integer  $group_id, array  $data, string  $pre_page) : string

The controller used to display a wiki page might vary (could be group or static). Links within a wiki page need to be updated to reflect which controller is being used. This method does the update.

Parameters

integer $group_id

id of wiki page the passed page belongs to

array $data

fields etc which will be sent to the view

string $pre_page

a wiki page where links,etc have not yet had dynamic substitutions applied

Returns

string —

page after subustitutions