XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
RMTemplate Class Reference

Public Member Functions

 __construct ()
 
 add_head ($head)
 
 add_head_script ($script)
 
 add_help ($caption, $link)
 
 add_jquery ($ui=true, $local=true)
 
 add_local_script ($file, $element='rmcommon', $subfolder='', $type='text/javascript', $more='', $footer=false)
 
 add_menu ($title, $link, $icon='', $class='', $location='', $options=array())
 
 add_menu_option ($caption, $link, $icon='', $class='', $target='')
 
 add_message ($message, $level=0)
 
 add_meta ($name, $content)
 
 add_script ($url, $type='text/javascript', $footer=false)
 
 add_scripts_array ($scripts)
 
 add_separator ()
 
 add_style ($sheet, $element='rmcommon', $subfolder='', $media='all', $more='', $front=false, $footer=false)
 
 add_styles_array ($styles)
 
 add_theme_script ($script, $theme='', $subfolder='', $type='text/javascript', $more='', $footer=false)
 
 add_theme_style ($sheet, $theme='', $subfolder='', $media='all', $more='', $footer=false)
 
 add_tool ($title, $link, $icon='', $location='')
 
 add_xoops_style ($sheet, $element='rmcommon', $subfolder='', $media='all', $more='', $footer=false)
 
 append ($varname, $value)
 
 assign ($varname, $value)
 
 clear_scripts ()
 
 clear_styles ()
 
 footer ()
 
 get ()
 
 get_head ()
 
 get_menus ()
 
 get_messages ()
 
 get_metas ()
 
 get_scripts ()
 
 get_styles ()
 
 get_template ($file, $type='module', $module='rmcommon', $plugin='')
 
 get_toolbar ()
 
 get_var ($varname)
 
 head_scripts ()
 
 header ()
 
 help ($single=0)
 
 location_id ($id)
 
 menu_options ()
 
 set_help ($link)
 
 style_url ($sheet, $element='rmcommon', $subfolder='')
 
 tpl_path ($file, $module, $subdir= 'templates')
 
 vars ()
 

Public Attributes

 $tpl_head = array()
 
 $tpl_hscripts = array()
 
 $tpl_scripts = array()
 
 $tpl_styles = array()
 

Private Attributes

 $help_link = array()
 
 $menus = array()
 
 $messages = array()
 
 $metas = array()
 
 $toolbar = array()
 
 $tpl_menus = array()
 
 $tpl_vars = array()
 
 $type = 'front'
 
 $version = ''
 

Detailed Description

This file can handle templates for all modules and themes

Definition at line 16 of file template.php.

Constructor & Destructor Documentation

RMTemplate::__construct ( )

At this moment this method do nothing Maybe later i will add some functionality... i must to think ;)

Definition at line 68 of file template.php.

References $rmc_config, add_jquery(), and RMCVERSION.

Here is the call graph for this function:

Member Function Documentation

RMTemplate::add_head (   $head)

Add elements to "HEAD" section of the page

Parameters
string|arrayElementos de HEAD
Returns
null

Definition at line 260 of file template.php.

References endif.

RMTemplate::add_head_script (   $script)

Add a script to head of page This method must be used when a script between <script> tags need to be added to head

Definition at line 304 of file template.php.

RMTemplate::add_help (   $caption,
  $link 
)

Definition at line 232 of file template.php.

Referenced by set_help().

Here is the caller graph for this function:

RMTemplate::add_jquery (   $ui = true,
  $local = true 
)

Add jQuery script to site header

Definition at line 420 of file template.php.

References $rmc_config, add_local_script(), and add_script().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

RMTemplate::add_local_script (   $file,
  $element = 'rmcommon',
  $subfolder = '',
  $type = 'text/javascript',
  $more = '',
  $footer = false 
)

This function add a scritp directly from an element

Definition at line 330 of file template.php.

References $file, $id, $rmc_config, $type, $url, $xoopsConfig, RMCPATH, and RMCURL.

Referenced by add_jquery().

Here is the caller graph for this function:

RMTemplate::add_menu (   $title,
  $link,
  $icon = '',
  $class = '',
  $location = '',
  $options = array() 
)

Menu Widgets

Definition at line 696 of file template.php.

References $class, and $options.

RMTemplate::add_menu_option (   $caption,
  $link,
  $icon = '',
  $class = '',
  $target = '' 
)

Add option to menu. This method is only functional in admin section or with the themes that support this feature

Parameters
stringMenu parent name
stringCaption
stringOption link url
stringOption icon url
stringTarget window (_clank, _self, etc.)

Definition at line 670 of file template.php.

References $class, $id, and $target.

RMTemplate::add_message (   $message,
  $level = 0 
)

Add a message to show in theme

Parameters
stringMessage to show
intLevel of message (1 will show error)

Definition at line 244 of file template.php.

RMTemplate::add_meta (   $name,
  $content 
)

Add metas to head

Definition at line 727 of file template.php.

References $content.

RMTemplate::add_script (   $url,
  $type = 'text/javascript',
  $footer = false 
)

Add scripts to theme. Scripts can be added trough method add_head passing all "script" tag as parameter but this method offers a shortest way.

Parameters
stringScript URL
stringScript Type (text/javascript)
Returns
null

Definition at line 284 of file template.php.

References $id, $type, and $url.

Referenced by add_jquery(), and add_scripts_array().

Here is the caller graph for this function:

RMTemplate::add_scripts_array (   $scripts)

Assign an array of scripts with values pairs url, type

Definition at line 451 of file template.php.

References $scripts, and add_script().

Here is the call graph for this function:

RMTemplate::add_separator ( )

Definition at line 680 of file template.php.

RMTemplate::add_style (   $sheet,
  $element = 'rmcommon',
  $subfolder = '',
  $media = 'all',
  $more = '',
  $front = false,
  $footer = false 
)

Add CSS style sheet to HEAD section of the HTMl page Note: must be used when stylesheet is an absolute url (or remote url)

Parameters

Definition at line 465 of file template.php.

References $id, $rmc_config, $url, $xoopsConfig, RMCPATH, and RMCURL.

Referenced by add_styles_array(), and add_xoops_style().

Here is the caller graph for this function:

RMTemplate::add_styles_array (   $styles)

Assign an array of scripts with values pairs url, type

Definition at line 616 of file template.php.

References $styles, and add_style().

Here is the call graph for this function:

RMTemplate::add_theme_script (   $script,
  $theme = '',
  $subfolder = '',
  $type = 'text/javascript',
  $more = '',
  $footer = false 
)

Definition at line 380 of file template.php.

References $file, $id, $rmc_config, $type, $url, $xoopsConfig, RMCPATH, and RMCURL.

RMTemplate::add_theme_style (   $sheet,
  $theme = '',
  $subfolder = '',
  $media = 'all',
  $more = '',
  $footer = false 
)

Add a style provided by theme

Parameters
stringFile name
stringTheme name where css sheet resides
stringSubfolder inside theme css folder
stringmedia type
stringAnother <style> tag attribs

Definition at line 525 of file template.php.

References $file, $id, $rmc_config, $url, $xoopsConfig, RMCPATH, and RMCURL.

RMTemplate::add_tool (   $title,
  $link,
  $icon = '',
  $location = '' 
)

Definition at line 711 of file template.php.

RMTemplate::add_xoops_style (   $sheet,
  $element = 'rmcommon',
  $subfolder = '',
  $media = 'all',
  $more = '',
  $footer = false 
)

Add a style for the front section

Definition at line 511 of file template.php.

References add_style().

Here is the call graph for this function:

RMTemplate::append (   $varname,
  $value 
)

Store vars inside template as array

Parameters
stringVar name
mixedVar valu

Definition at line 638 of file template.php.

RMTemplate::assign (   $varname,
  $value 
)

Assign template vars

Parameters
stringVar name
anyVar value

Definition at line 630 of file template.php.

RMTemplate::clear_scripts ( )

Clear all scripts stores

Definition at line 445 of file template.php.

RMTemplate::clear_styles ( )

Clear all styles stores

Definition at line 610 of file template.php.

RMTemplate::footer ( )

Definition at line 100 of file template.php.

References $content, $rmc_config, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, RMFunctions\configs(), RMEvents\get(), RMCPATH, and RMCURL.

Here is the call graph for this function:

RMTemplate::get_head ( )

Get all items in head

Returns
array

Definition at line 272 of file template.php.

References $tpl_head.

RMTemplate::get_menus ( )

Definition at line 707 of file template.php.

References $menus.

RMTemplate::get_messages ( )

Get all messages

Returns
array

Definition at line 251 of file template.php.

References $messages.

RMTemplate::get_metas ( )

Definition at line 732 of file template.php.

References $metas.

RMTemplate::get_scripts ( )

Get all scripts stored in class

Definition at line 436 of file template.php.

References $ev, $tpl_scripts, and RMEvents\get().

Here is the call graph for this function:

RMTemplate::get_styles ( )

Get all styles stored in class

Definition at line 602 of file template.php.

References $ev, $tpl_styles, and RMEvents\get().

Here is the call graph for this function:

RMTemplate::get_template (   $file,
  $type = 'module',
  $module = 'rmcommon',
  $plugin = '' 
)

Get a template from Current RMCommon Theme

Parameters
stringTemplate file name
stringElemernt type: module or plugin
stringModule name
stringPlugin name, only when type = plugin
Returns
string Template path

Definition at line 139 of file template.php.

References $file, $rmc_config, $type, $xoopsConfig, and RMCPATH.

Referenced by RMForm\display(), and RMForm\render().

Here is the caller graph for this function:

RMTemplate::get_toolbar ( )

Definition at line 720 of file template.php.

References $toolbar.

RMTemplate::get_var (   $varname)

Get a single template var

Parameters
stringVar name
Returns
any

Definition at line 653 of file template.php.

RMTemplate::head_scripts ( )

Get all head scripts

Definition at line 311 of file template.php.

References $ret.

RMTemplate::header ( )

Definition at line 96 of file template.php.

RMTemplate::help (   $single = 0)

Definition at line 225 of file template.php.

References $help_link.

RMTemplate::location_id (   $id)

Set the location identifier for current page This identifier will help to RMCommon to find widgets, forms, etc

Definition at line 211 of file template.php.

RMTemplate::menu_options ( )

Get all menu options

Definition at line 686 of file template.php.

References $tpl_menus, and RMEvents\get().

Here is the call graph for this function:

RMTemplate::set_help (   $link)

Add a help lint to manage diferents sections

Parameters
stringLink to help resource

Definition at line 219 of file template.php.

References __(), and add_help().

Here is the call graph for this function:

RMTemplate::style_url (   $sheet,
  $element = 'rmcommon',
  $subfolder = '' 
)

Get a style url formatted

Definition at line 567 of file template.php.

References $file, $rmc_config, $url, $xoopsConfig, RMCPATH, and RMCURL.

RMTemplate::tpl_path (   $file,
  $module,
  $subdir = 'templates' 
)

Get template path for front section

Parameters
stringFile path inside module folder
stringModule directory name
Returns
string

Definition at line 190 of file template.php.

References $file, and $xoopsConfig.

RMTemplate::vars ( )

Get all template vars as an array

Definition at line 644 of file template.php.

References $tpl_vars.

Member Data Documentation

RMTemplate::$help_link = array()
private

Help link

Definition at line 55 of file template.php.

Referenced by help().

RMTemplate::$menus = array()
private

Menus for admin gui

Definition at line 47 of file template.php.

Referenced by get_menus().

RMTemplate::$messages = array()
private

Messages for template

Definition at line 43 of file template.php.

Referenced by get_messages().

RMTemplate::$metas = array()
private

Metas

Definition at line 59 of file template.php.

Referenced by get_metas().

RMTemplate::$toolbar = array()
private

Toolbar for admin gui

Definition at line 51 of file template.php.

Referenced by get_toolbar().

RMTemplate::$tpl_head = array()

Stores the information for 'HEAD' section of template

Definition at line 22 of file template.php.

Referenced by get_head().

RMTemplate::$tpl_hscripts = array()

Definition at line 27 of file template.php.

RMTemplate::$tpl_menus = array()
private

Menu options for current element

Definition at line 35 of file template.php.

Referenced by menu_options().

RMTemplate::$tpl_scripts = array()

Stores the scripts information to include in theme

Definition at line 26 of file template.php.

Referenced by get_scripts().

RMTemplate::$tpl_styles = array()

Stores all styles for HEAD section

Definition at line 31 of file template.php.

Referenced by get_styles().

RMTemplate::$tpl_vars = array()
private

Template Vars

Definition at line 39 of file template.php.

Referenced by vars().

RMTemplate::$type = 'front'
private

Definition at line 18 of file template.php.

Referenced by add_local_script(), add_script(), add_theme_script(), and get_template().

RMTemplate::$version = ''
private

Version to add as parameter to scripts and styles

Definition at line 63 of file template.php.


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