$view
$view : object
The View on which this Element is drawn
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
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.
array | $data | fields contain data about the page being displayed or edited, or the list of pages being displayed. |
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
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 |
renderResources(array $data, boolean $read_mode, boolean $logged_in = true)
Draws a list of media resources associated with a wiki page
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(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
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(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
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 |
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.
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 |
page after subustitutions