),
'debug' => array(
- 'desc' => 'Turn on debuggin',
+ 'desc' => 'Turn on debugging',
'default' => '',
'short' => 'd',
'min' => 1,
return true;
}
- function get($tbl, $opts)
+ function get($tbl, $opts=array())
{
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
function fixOldNames()
{
$ff = HTML_FlexyFramework::get();
+ if (empty($ff->Pman_Cms)) {
+ $this->jerr("config[Pman_Cms] is not set");
+ }
+
$base = $ff->Pman_Cms['project_name'];
$tdirs = $ff->Pman_Cms['templateDir'];
if (!is_array($tdirs)) {
$page_templates[$pg['template']] =1;
}
- //print_R($pages); exit;;
+
$pages[] = $pg;
}
-
+ //print_R($pages); exit;;
// now generate all the templates..
continue;
}
+
$pages[$i]['template_object'] = $tp->syncTemplatePage($pg);
+ // print_r($pages[$i]['template_object'] );exit;
+
}
- //print_R($pages); exit;
- $pgo = DB_DataObject::factory('cms_page');
+ $pgo = DB_DataObject::factory('cms_page');
foreach($pages as $i=>$pg) {
if (!empty($this->opts['template']) && $this->opts['template'] != ($pg['template_dir'] . '/'. $pg['template'])) {
}
$ff = HTML_FlexyFramework::get();
$opt_lang = empty($ff->Pman_Core_I18n) ? array( 'l' => array()) : $ff->Pman_Core_I18n;
+
+ $langs = $opt_lang['l'] ;
+ // see what languages are in there already!?
+ $cl = DB_DataObject::factory('cms_templatestr');
+ $cl->selectAdd();
+ $cl->selectAdd('distinct(lang) as lang');
+ $cl->whereAdd("lang != ''");
+ $dblangs = $cl->fetchAll('lang');
+ foreach($langs as $l) {
+ if (!in_array($$l, $dblangs)) {
+ $dblangs[] = $l;
+ }
+ }
+
+
+
// templates.. -- assume the above does the template syncing..
//DB_DataObject::DebugLevel(1);
echo "Sync the Languages template.....\n";
- foreach($opt_lang['l'] as $l) {
+ foreach($dblangs as $l) {
echo "Sync $l Language.....\n";
$tps = DB_DataObject::factory('cms_templatestr');
$tps->syncLang($l); /// this should be configured somewhere..
foreach($prefixes as $pr) {
-
+ // print_r($x);
$add = array(
'base' => $pr,
}
-
+ //print_r($ret);exit;
$dh = opendir($class_dir);
$cls = $class_base .'_' . str_replace('/', '_', preg_replace('/.php$/', '', $fn));
if (!class_exists($cls)) {
echo "SKIP - not a PHP class $cls\n";
+ continue;
}
if (!is_a($cls,'HTML_FlexyFramework_Page')) {
echo "SKIP - not a PHP class $cls\n";
+ continue;
}
$x = new $cls();
echo "TSCAN base= $base subdir =$subdir\n ";
$ff = HTML_FlexyFramework::get();
- $generate_cms_page_for = $ff->Pman_Cms['generate_cms_page_for'];
+ $generate_cms_page_for = isset($ff->Pman_Cms['generate_cms_page_for']) ? $ff->Pman_Cms['generate_cms_page_for'] : false;
$tdirs = $ff->Pman_Cms['templateDir'];