Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
NewsSection Class Reference
Inheritance diagram for NewsSection:
tariqa3ModuleSection tariqa3Module baseModule_RELEX_TARIQANG BaseModuleWithAuthenticationAndLanguages BaseModuleWithAuthentication BaseModule mModule

Public Member Functions

 __construct ($config, $parentBase, $section_id, $translationTable, $flavours, $queries, $propertiesSection, $refresh=false)
 getPageContent ()
 afterSection ()

Static Public Member Functions

static renderCustomFilter ($custom_filter, $q, $translationTable, $template_path, $flavour_id=null)
static getArticleControls ($flavour_id, $query, $custom_filters, $translationTable, $template_path, $user, $bf_link=false)
static getFiltering ($flavour_id, $query, $custom_filters, $translationTable, $template_path, $bf_link=false)
static getSourcesList ($current, $queries, $template_file, $translationTable)
static setFlavour ($section, $query)

Data Fields

const NO_SOURCE = '<!--No source to change-->'

Protected Attributes

 $refresh

Constructor & Destructor Documentation

__construct ( config,
parentBase,
section_id,
translationTable,
flavours,
queries,
propertiesSection,
refresh = false 
)

Constructs the object

Parameters:
array$configThe configuration array
string$parentBasebase_folder of the container class
string$section_idThe section identifier
array$translationTableThe translation table
Flavour[]The list of flavours
Query[][]The list of queries grouped by queries
string$propertiesSectionThe properties section (to read the user defined filters and queries from the user preferences)
boolean$refreshIf true, then refresh the news from the section [OPTIONAL] public
Returns:
void

Member Function Documentation

If you want to display something after a section, just redefine this function and return the HTML to be displayed public

Returns:
string

Reimplemented from tariqa3ModuleSection.

static getArticleControls ( flavour_id,
query,
custom_filters,
translationTable,
template_path,
user,
bf_link = false 
) [static]

Gets the article controls links html of a query block

Parameters:
int$flavour_idThe flavour id (which is basically the tab on which the query is displayed)
Query$queryThe query
array$custom_filtersThe custom filters (it is possible that a filter is allready set)
array$translationTableThe translation table
string$template_pathThe path to the template files
tariqaUser$userThe tariqa user
boolean$bf_linkIf true, also include the briefcase link public
Returns:
array
static getFiltering ( flavour_id,
query,
custom_filters,
translationTable,
template_path,
bf_link = false 
) [static]

Gets the filtering html of a query block

Parameters:
int$flavour_idThe flavour id (which is basically the tab on which the query is displayed)
Query$queryThe query
array$custom_filtersThe custom filters (it is possible that a filter is allready set)
array$translationTableThe translation table
string$template_pathThe path to the template files
boolean$bf_linkIf true, also include the briefcase link public
Returns:
array

Render the module

Returns:
string

Reimplemented from tariqa3Module.

static getSourcesList ( current,
queries,
template_file,
translationTable 
) [static]

Generates the div with the list of sources ommiting the current query source for a given flavour

Parameters:
Query$currentThe current query (this will not be displayed in the list
Query[]$queries The list of queries
string$template_fileThe template file to generate the sources list HTML
array$translationTableThe translation table public
Returns:
array
static renderCustomFilter ( custom_filter,
q,
translationTable,
template_path,
flavour_id = null 
) [static]

Renders a custom filter for a flavour in the country page or theme page (returns an associative array with the HTML code needed to display the filter, the query string, the start date (UNIX timestamp format) and the end date (UNIX timestamp format)

Parameters:
string$custom_filterThe custom filter from the database (in URL form - query=lower(title) like obama&start_date=...&end_date=...)
Query$qThe query identifier to filter
array$translationTableThe translation table
string$template_pathThe path to the template file
int$flavour_idThe flavour identifier (this has been added due to a small bug in the query table - it contains the flavour_id) [OPTIONAL] public
Returns:
array
static setFlavour ( section,
query 
) [static]

Sets the flavour for a query flavour (if we display the news section for example into the theme pages, then the flavours are just the name and id of the tabs, and not the flavours from the database)

Parameters:
array$sectionThe section (this will indicate if we are on a country page, on a theme page etc.
Query$queryThe query for which we are trying to get the flavour public
Returns:
void

Field Documentation

$refresh [protected]
const NO_SOURCE = '<!--No source to change-->'

The documentation for this class was generated from the following file: