Resource specification

Registered by Greg

How a given resource can be specified in order for several pieces to refer to the same resource (especially the external lib)

Blueprint information

Status:
Not started
Approver:
TitanKing
Priority:
Low
Drafter:
Greg
Direction:
Approved
Assignee:
Greg
Definition:
New
Series goal:
None
Implementation:
Deferred
Milestone target:
None

Related branches

Sprints

Whiteboard

(note: this mostly apply to embedded mode)

There are three ways of identifying a resource:

- by ID (the one PHPDS computes)
- by plugin and alias
- by href

that means a resource can be given as one variable:
- if it's a number, it's an ID
- if it's a string, it's a href
- if it's an array, it's a (plugin, alias) pair (with optional parameters)

Moreover, if the resource specification is void, it can be considered we are refering to the "current" resource, based on the current URL (matching the href).

In case of an array, the first item is seen as the plugin, the rest is concatenated with underscores ("_") and seen as the menu alias. For example:

Plugin: Courses
Menu: Planning
Parameter: physics

-> would give a URL like: http://www.myschool.org/planning.html?course=physics
-> in PHPDS menu management: menu with plugin 'Courses' and alias 'planning_physics'
-> the corresponding array is then: array('Courses', 'planning_physics') or array('Courses', 'planning', 'physics')

The second form is made to make the coding easier:

    $form = new PHPDS_loginForm;
    $form->check(array('Courses', 'planning', $_GET['course']));

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.