OSB enhancements to date

This commit is contained in:
Deon George
2010-11-30 09:41:08 +11:00
parent 8715a2059b
commit ec6a542bc3
478 changed files with 23423 additions and 9309 deletions

View File

@@ -0,0 +1,31 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @package OSB
* @subpackage EmailTemplate
* @category Models
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Model_EmailTemplate extends ORMOSB {
protected $_table_name = 'email_template';
protected $_has_many = array(
'emailtemplate_translate'=>array('foreign_key'=>'email_template_id'),
);
// This module doesnt keep track of column updates automatically
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
protected $_formats = array(
'active'=>array('StaticList_YesNo::display'=>array()),
);
protected $_sorting = array(
'name'=>'ASC',
);
}
?>

View File

@@ -0,0 +1,34 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @package OSB
* @subpackage EmailTemplate
* @category Models
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Model_EmailTemplate_Translate extends ORMOSB {
protected $_table_name = 'email_template_translate';
// This module doesnt keep track of column updates automatically
protected $_created_column = FALSE;
protected $_updated_column = FALSE;
public function variables($field) {
$results = array();
$matches = array();
preg_match_all('/%([A-Z0-9_]+)%/U',$this->$field,$matches,PREG_OFFSET_CAPTURE);
foreach ($matches[1] as $k => $v)
$results[$v[1]] = $v[0];
$results = array_unique($results);
asort($results);
return $results;
}
}
?>