public function test_should_find_using_named_bindings() { $this->installAndIncludeModels(array('Hybrid' => 'id,customer_id,input,parent_id')); $Hybrid = new Hybrid(); $customer_id = 12; $input = 'abc'; $parent_id = 123; $Hybrid->create(array('customer_id' => $customer_id, 'input' => $input, 'parent_id' => $parent_id)); $results = $Hybrid->find('all', array('conditions' => array('customer_id = :customer_id AND input = :input AND parent_id = :parent_id', ':customer_id' => $customer_id, ':input' => $input, ':parent_id' => $parent_id))); $this->assertEqual(Ak::pick('customer_id,input,parent_id', $results[0]->getAttributes()), array('customer_id' => $customer_id, 'input' => $input, 'parent_id' => $parent_id)); }
function theme_support() { parent::theme_support(); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-sidebars', array('primary')); add_theme_support('breadcrumb-trail'); }
/** * Remove name attributes in the back end so the form is not validated * @return string */ public function generate() { $str = parent::generate(); if (TL_MODE == 'BE') { $str = preg_replace('/name="[^"]+" ?/i', '', $str); } return $str; }
/** * Remove name attributes in the back end so the form is not validated * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['CTE']['form'][0]) . ' ###'; $objTemplate->id = $this->id; $objTemplate->link = $this->title; $objTemplate->href = 'contao/main.php?do=form&table=tl_form_field&id=' . $this->id; return $objTemplate->parse(); } return parent::generate(); }
<?php /** * Rather than lumping all theme functions into a single file, this functions file is used for * initializing the theme framework, which activates files in the order that it needs. Users * should create a child theme and make changes to its functions.php file (not this one). * * @package Hybrid * @subpackage Functions */ /* Load the Hybrid class. */ require_once( TEMPLATEPATH . '/library/classes/hybrid.php' ); /* Initialize the Hybrid framework. */ $hybrid = new Hybrid(); $hybrid->init(); add_action('init', 'initer'); function initer() { // hard code this remove_action( 'hybrid_head', 'hybrid_meta_content_type' ); remove_action( 'hybrid_after_header', 'hybrid_page_nav' ); } function body_class_page_name($echo = false) { global $post; $parent_title = strtolower(str_replace(" ", "-", get_the_title($post->post_parent))); $page_name = strtolower(str_replace(" ", "-", get_the_title())); $page_name = str_replace(".", "", $page_name); if ($parent_title == $page_name) $parent_title=" home-parent";
public function test_null_should_not_be_casted_as_false_on_booleans() { $Celebrity = new Hybrid(array('title' => 'Franko', 'celebrity' => null)); $Celebrity->save(); $Celebrity = $this->Hybrid->find('first', array('title' => 'Franko')); $this->assertNull($Celebrity->celebrity); }
public function generate() { return Hybrid::generate(); }
/** * Generate the list. * * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = $this->wildCardName; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = sprintf($this->wildCardLink, $this->id); return $objTemplate->parse(); } return parent::generate(); }