backbone.module |
|
---|---|
<?php
function backbone_help($path, $arg)
|
|
Implements hook_init(). Add backbone.js and dependency underscore.js to all pages, along with related settings. TODO Make this conditional by page/configurable. |
<?php
function backbone_init()
|
Implements hook_menu(). |
<?php
function backbone_menu()
|
Implements hook_permission(). |
<?php
function backbone_permission()
|
Implements hook_theme(). |
<?php
function backbone_theme($existing, $type, $theme, $path)
|
Theme function for wrapping the template as needed for Backbone.View.render. By default, Drupal.Backbone.View uses Underscore templating and the element's DOM ID to extract the template source. Variables array containing the id and source for the template. Note: all template sources provided by modules should be provided by theme functions as well, so they can be overridden at the theme level as desired. The HTML for the wrapped template. |
<?php
function theme_backbone_template($variables = array())
|
Add template to array of templates to be included in page. Uses a global to store array, attaches at hookpagebuild. The id of this template, will be the selector used in Backbone View. The source code of the template. Note: all template sources provided by modules should be provided by theme functions as well, so they can be overridden at the theme level as desired. Does not return anything of note. |
<?php
function backbone_add_template($template_id, $template_source)
|
Get the tempalates array. Abstracts from the global, so implementation can be refactored as needed. Array of templates, keyed by template id. |
<?php
function backbone_get_templates()
|
Implements hookpagebuild(). Add the templates to the render array for the page, at the bottom of the page. Uses the backbone_template theme hook to wrap in appropriate element for the template library being used. Currently supports _.template() function.
|
<?php
function backbone_page_build(&$page)
|
Implements hook_library(). |
<?php
function backbone_library()
|
Implements hooklibraryalter(). Standard method for including qunit tests if qunit is enabled. |
<?php
function backbone_library_alter(&$libraries, $module)
|
Abstraction function to simplify default variable values. Variable name, minus the "backbone_" prefix. The default value of the variable, if null, we look up in a defaults array in this function. Value of variable or default. |
<?php
function _backbone_variable_get($name, $default_value = NULL)
|