Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Procedural File: lib-topic.php

Source Location: /system/lib-topic.php



Page Details:








TOPIC_ALL_OPTION [line 43]

TOPIC_ALL_OPTION = 'all'

[ Top ]



TOPIC_HOMEONLY_OPTION [line 45]

TOPIC_HOMEONLY_OPTION = 'homeonly'

[ Top ]



TOPIC_NONE_OPTION [line 44]

TOPIC_NONE_OPTION = 'none'

[ Top ]



TOPIC_ROOT [line 47]

TOPIC_ROOT = 'root'

[ Top ]



TOPIC_SELECTED_OPTION [line 46]

TOPIC_SELECTED_OPTION = 'selectedtopics'

[ Top ]




plugin_autotags_topic [line 1644]

void plugin_autotags_topic( string $op, [string $content = ''], [array $autotag = ''], mixed 3)

Implements the [topic:] autotag.



Parameters

string   $op   operation to perform
string   $content   item (e.g. topic text), including the autotag
array   $autotag   parameters used in the autotag
mixed   3   tag names (for $op='tagname') or formatted content
[ Top ]



plugin_group_changed_topic [line 1819]

void plugin_group_changed_topic( int $grp_id, string $mode)

This function is called to inform plugins when a group's information has changed or a new group has been created.



Parameters

int   $grp_id   Group ID
string   $mode   type of change: 'new', 'edit', or 'delete'
[ Top ]



plugin_user_changed_topic [line 1853]

void plugin_user_changed_topic( int $uid)

This function is called when a user's information (profile or preferences) has changed.



Parameters

int   $uid   user id
[ Top ]



TOPIC_addTopicAssignments [line 1130]

nothing TOPIC_addTopicAssignments( string $type, string/array $id, [ $tid = ''])

Add Topic Assignments for a specfic object



Parameters

string   $type   Type of object to find topic access about.
string/array   $id   ID of object
   $tid  
[ Top ]



TOPIC_breadcrumbs [line 1316]

string TOPIC_breadcrumbs( string $type, string/array $id)

If found returns one or more html breadcrumb. Used by Topics, Stories and Plugins.



Tags:

return:  1 or more breadcrumb trail in html


Parameters

string   $type   Type of object to create breadcrumb trail
string/array   $id   ID of object
[ Top ]



TOPIC_buildTree [line 74]

array TOPIC_buildTree( $id, [ $parent = ''], [ $branch_level = -1], [ $tree_array = array()])

Return the topic tree structure in an array.



Parameters

   $id  
   $parent  
   $branch_level  
   $tree_array  
[ Top ]



TOPIC_checkList [line 330]

string TOPIC_checkList( [string $selected_ids = ''], [string $fieldname = ''], [boolean $language_specific = false], [boolean $remove_archive = false])

Creates a <input> checklist for topics

Creates a group of checkbox form fields with given arguments




Tags:

return:  HTML with Checkbox code


Parameters

string   $selected_ids   Value to set to CHECKED
string   $fieldname   Name to use for the checkbox array
boolean   $language_specific   If false include all topics for every language
boolean   $remove_archive   Remove archive topic from list if any
[ Top ]



TOPIC_checkTopicSelectionControl [line 661]

boolean TOPIC_checkTopicSelectionControl( )

Check topic control has selections made

This will return true for selection or false for no selections




Tags:

return:  true if selection made


[ Top ]



TOPIC_deleteTopicAssignments [line 1115]

nothing TOPIC_deleteTopicAssignments( string $type, string/array $id)

Delete Topic Assignments for a specfic object



Parameters

string   $type   Type of object to find topic access about.
string/array   $id   ID of object
[ Top ]



TOPIC_getChildList [line 193]

string TOPIC_getChildList( string $id, [int $uid = 0])

Return a list of child topic ids that the user has access to.

Includes the parent topic in the list as well.




Parameters

string   $id   The id of the parent topic
int   $uid   user id or 0 = current user
[ Top ]



TOPIC_getDataTopicSelectionControl [line 795]

void TOPIC_getDataTopicSelectionControl( &$topic_option, &$tids, &$inherit_tids, &$default_tid, string $topic_option, array $tids, array $inherit_tids, string $default_tid)

Get Post Data from topic control for an object



Parameters

string   $topic_option   Retrieved topic option selected
array   $tids   Retrieved topics selected
array   $inherit_tids   Retrieved inherited topics selected
string   $default_tid   Retrieved default topic selected
   &$topic_option  
   &$tids  
   &$inherit_tids  
   &$default_tid  
[ Top ]



TOPIC_getIndex [line 166]

int TOPIC_getIndex( string $id)

Return the index of a topic in the TOPICS array that matches the topic id



Parameters

string   $id   The id of the topic to find the index for
[ Top ]



TOPIC_getList [line 524]

array TOPIC_getList( [int $sortcol = 0], [boolean $ignorelang = true], [boolean $title = true])

Return a list of topics in an array



Tags:

return:  Array of topics


Parameters

int   $sortcol   Which field to sort option list by 0 (value) or 1 (label)
boolean   $ignorelang   Whether to return all topics (true) or only the ones for the current language (false)
boolean   $title   Return topic ids as well as topic titles
[ Top ]



TOPIC_getOtherListSelect [line 253]

HTML TOPIC_getOtherListSelect( string $type, string $id, [string/array $selected_ids = array()], [string/array $tids = array()])

This function creates html options for Inherited and default Topics



Tags:

return:  string


Parameters

string   $type   Type of object to display access for
string   $id   Id of onject
string/array   $selected_ids   Topics Ids to mark as selected
string/array   $tids   Topics Ids to use instead of retrieving from db
[ Top ]



TOPIC_getTopic [line 1190]

void TOPIC_getTopic( [string $type = ''], [string/array $id = ''])

Figure out the current topic for a plugin. If permissions or language wrong

will find default else end with a '' topic (which is all). Needs to be run on page that is affected by the topic after lib-common.php so it can grab topic in url if need be. Also if pass blank $type and $id then return just last topic




Parameters

string   $type   Type of object to find topic access about.
string/array   $id   ID of object
[ Top ]



TOPIC_getTopicAdminColumn [line 1150]

string TOPIC_getTopicAdminColumn( string $type, string/array $id)

Return Topic list for Admin list Topic Column (need to handle 'all' and 'homeonly' as special cases)



Tags:

return:  Returns topic list


Parameters

string   $type   Type of object to find topic access about.
string/array   $id   ID of object
[ Top ]



TOPIC_getTopicDefault [line 1080]

string TOPIC_getTopicDefault( string $type, [string/array $id = ''])

Retrieve default topic from selection



Tags:

return:  Returns default topic id or empty string if not found


Parameters

string   $type   Type of object to find topic access about. If 'topic' then will check post array for topic selection control
string/array   $id   ID of block or topic to check if block topic access
[ Top ]



TOPIC_getTopicIdsForObject [line 1027]

array TOPIC_getTopicIdsForObject( string $type, [string/array $id = ''], [int $uid = -1])

Retrieve topics from selection or retrieve topics for object from db



Tags:

return:  Returns default topic id or empty string if not found


Parameters

string   $type   Type of object to find topic access about. If 'topic' then will check post array for topic selection control
string/array   $id   ID of block or topic to check if block topic access
int   $uid   User id (not currently implemented) or 0 = current user or -1 = do not check access
[ Top ]



TOPIC_getTopicListSelect [line 405]

HTML TOPIC_getTopicListSelect( [string/array $selected_ids = array()], [int $include_root_all = 1], [boolean $language_specific = false], [string $remove_id = ''], [boolean $remove_archive = false], [int $uid = 0])

This function creates html options for Topics, for a single or multi select box



Tags:

return:  string


Parameters

string/array   $selected_ids   Topics Ids to mark as selected
int   $include_root_all   Include Nothing (0) or Root (1) or All (2) or None (4) in list.
boolean   $language_specific   If false include all topics for every language
string   $remove_id   Id of topic to not include (includes any children) (used for selection of parent id)
boolean   $remove_archive   Remove archive topic from list if any
int   $uid   User id or 0 = current user
[ Top ]



TOPIC_getTopicSelectionControl [line 840]

string TOPIC_getTopicSelectionControl( string $type, string $id, [boolean $show_options = false], [boolean $show_inherit = false], [boolean $show_default = false])

Shows topic control for an object

This will return the HTML needed to create the topic control seen on the admin screen for GL objects (i.e. stories, blocks, etc)




Tags:

return:  needed HTML (table) in HTML


Parameters

string   $type   Type of object to display access for
string   $id   Id of onject (if '' then load date from control)
boolean   $show_options   True/False. If true then All and Homepage options will be visible
boolean   $show_inherit   True/False. If true then inhert selection will be enabled
boolean   $show_default   True/False. If true then default topic selection will be enabled
[ Top ]



TOPIC_hasMultiTopicAccess [line 583]

int TOPIC_hasMultiTopicAccess( string $type, [string/array $id = ''], [string/array $tid = ''])

Check for topic access from a list of topics or for an object If multiple topics then will return the lowest access level found (need to handle 'all' and 'homeonly' as special cases)



Tags:

return:  returns 3 for read/edit 2 for read only 0 for no access


Parameters

string   $type   Type of object to find topic access about. If 'topic' then will check post array for topic selection control
string/array   $id   ID of object to check topic access for (not requried if $type is 'topic')
string/array   $tid   ID of topic to check topic access for (not requried and not used if $type is 'topic')
[ Top ]



TOPIC_inPath [line 1425]

boolean TOPIC_inPath( string $tid, [string $current_tid = ''])

Checks to see if the topic id given is in the current topic path (bases on current users's access).



Tags:

return:  False if not found or no access or if no current topic


Parameters

string   $tid   Topic Id to check if in parent path
string   $current_tid   Current Topic Id (the path to check). If blank then assume actual current topic
[ Top ]



TOPIC_relatedItems [line 1555]

HTML TOPIC_relatedItems( string $type, string $id, [ $include_types = array()], [integer $max = 10], [integer $trim = 0], [string/array $tids = array()])

This function creates a list of the newest and recently modified items that are related based on the topics passed or that the object belongs too



Tags:

return:  string


Parameters

string   $type   Type of object to display access for
string   $id   Id of onject
integer   $max   Max number of items returned
integer   $trim   Max length of link text
string/array   $tids   Topics Ids to use instead of retrieving from db
   $include_types  
[ Top ]



TOPIC_relatedTopics [line 1469]

HTML TOPIC_relatedTopics( string $type, string $id, [integer $max = 6], [string/array $tids = array()])

This function creates an html list of topics the object belongs too or creates a similar list based on topics passed to it



Tags:

return:  string


Parameters

string   $type   Type of object to display access for
string   $id   Id of onject
integer   $max   Max number of items returned
string/array   $tids   Topics Ids to use instead of retrieving from db
[ Top ]



TOPIC_saveTopicSelectionControl [line 706]

boolean TOPIC_saveTopicSelectionControl( string $type, string $id)

Saves topic control to db for an object

This will save the selections from the topic control seen on the admin screen for GL objects (i.e. stories, blocks, etc)




Tags:

return:  true if successful else false


Parameters

string   $type   Type of object to display access for
string   $id   Id of object
[ Top ]



Documentation generated on Sun, 02 Oct 2016 07:51:42 +0000 by phpDocumentor 1.4.3