Made changes to the compiler in relation to version control. Resolved gh-154 to insure string translation for state values. Added shortcuts in Joomla Component list view to all linked tables in their relationship with the Joomla Component
This commit is contained in:
@ -615,7 +615,8 @@ class Get
|
||||
'i.dashboard_tab',
|
||||
'i.php_dashboard_methods',
|
||||
'f.sql_tweak',
|
||||
'e.version_update'
|
||||
'e.version_update',
|
||||
'e.id'
|
||||
),
|
||||
array(
|
||||
'addadmin_views',
|
||||
@ -629,7 +630,8 @@ class Get
|
||||
'dashboard_tab',
|
||||
'php_dashboard_methods',
|
||||
'sql_tweak',
|
||||
'version_update'
|
||||
'version_update',
|
||||
'version_update_id'
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -791,15 +793,15 @@ class Get
|
||||
// has become a lacacy issue, can't remove this
|
||||
$array['view'] = $array['adminview'];
|
||||
$array['settings'] = $this->getAdminViewData($array['view']);
|
||||
if ($array['port'] && !$this->addEximport)
|
||||
if (isset($array['port']) && $array['port'] && !$this->addEximport)
|
||||
{
|
||||
$this->addEximport = true;
|
||||
}
|
||||
if ($array['history'] && !$this->setTagHistory)
|
||||
if (isset($array['history']) && $array['history'] && !$this->setTagHistory)
|
||||
{
|
||||
$this->setTagHistory = true;
|
||||
}
|
||||
if ($array['edit_create_site_view'])
|
||||
if (isset($array['edit_create_site_view']) && $array['edit_create_site_view'])
|
||||
{
|
||||
$this->siteEditView[$array['adminview']] = true;
|
||||
}
|
||||
@ -886,23 +888,31 @@ class Get
|
||||
}
|
||||
|
||||
// build update SQL
|
||||
if ($old_component = $this->getHistoryWatch('joomla_component', $this->componentID) &&
|
||||
if ($old_component = $this->getHistoryWatch('joomla_component', $this->componentID) ||
|
||||
$old_admin_views = $this->getHistoryWatch('component_admin_views', $component->addadmin_views_id))
|
||||
{
|
||||
// add new views if found
|
||||
if (isset($old_admin_views->addadmin_views) && ComponentbuilderHelper::checkJson($old_admin_views->addadmin_views))
|
||||
if (ComponentbuilderHelper::checkObject($old_admin_views))
|
||||
{
|
||||
$this->setUpdateSQL(json_decode($old_admin_views->addadmin_views, true), $component->addadmin_views, 'adminview');
|
||||
// add new views if found
|
||||
if (isset($old_admin_views->addadmin_views) && ComponentbuilderHelper::checkJson($old_admin_views->addadmin_views))
|
||||
{
|
||||
$this->setUpdateSQL(json_decode($old_admin_views->addadmin_views, true), $component->addadmin_views, 'adminview');
|
||||
}
|
||||
// check if a new version was manualy set
|
||||
if (ComponentbuilderHelper::checkObject($old_component))
|
||||
{
|
||||
$old_component_version = preg_replace('/[^0-9.]+/', '', $old_component->component_version);
|
||||
if ($old_component_version != $this->component_version)
|
||||
{
|
||||
// yes, this is a new version, this mean there may be manual sql and must be checked and updated
|
||||
$component->old_component_version = $old_component_version;
|
||||
}
|
||||
// clear this data
|
||||
unset($old_component);
|
||||
}
|
||||
// clear this data
|
||||
unset($old_admin_views);
|
||||
}
|
||||
// check if a new version was manualy set
|
||||
$old_component_version = preg_replace('/[^0-9.]+/', '', $old_component->component_version);
|
||||
if ($old_component_version != $this->component_version)
|
||||
{
|
||||
// yes, this is a new version, this mean there may be manual sql and must be checked and updated
|
||||
$component->old_component_version = $old_component_version;
|
||||
}
|
||||
// clear this data
|
||||
unset($old_component);
|
||||
}
|
||||
// unset original value
|
||||
unset($component->addadmin_views);
|
||||
|
@ -619,7 +619,7 @@ class Structure extends Get
|
||||
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version);
|
||||
$this->buildDynamique($target,'single', false, $config);
|
||||
}
|
||||
if($view['edit_create_site_view'])
|
||||
if ( isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
||||
{
|
||||
// setup the front site edit-view files
|
||||
$target = array('site' => $view['settings']->name_single);
|
||||
@ -628,7 +628,7 @@ class Structure extends Get
|
||||
}
|
||||
}
|
||||
// quick set of checkin once
|
||||
if ($view['checkin'] == 1 && !$this->addCheckin)
|
||||
if (isset($view['checkin']) && $view['checkin'] == 1 && !$this->addCheckin)
|
||||
{
|
||||
// switch to add checking to config
|
||||
$this->addCheckin = true;
|
||||
|
@ -403,12 +403,12 @@ class Fields extends Structure
|
||||
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
|
||||
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
|
||||
// add metadata to the view
|
||||
if ($view['metadata'])
|
||||
if (isset($view['metadata']) && $view['metadata'])
|
||||
{
|
||||
$this->metadataBuilder[$viewName] = $viewName;
|
||||
}
|
||||
// add access to the view
|
||||
if ($view['access'])
|
||||
if (isset($view['access']) && $view['access'])
|
||||
{
|
||||
$this->accessBuilder[$viewName] = $viewName;
|
||||
}
|
||||
@ -1812,7 +1812,7 @@ class Fields extends Structure
|
||||
}
|
||||
}
|
||||
// add history to this view
|
||||
if ($view['history'])
|
||||
if (isset($view['history']) && $view['history'])
|
||||
{
|
||||
$this->historyBuilder[$viewName] = $viewName;
|
||||
}
|
||||
|
@ -728,25 +728,30 @@ class Interpretation extends Fields
|
||||
if (ComponentbuilderHelper::checkArray($this->updateSQLBuilder))
|
||||
{
|
||||
$buket = array();
|
||||
$buket['version'] = array();
|
||||
$buket['mysql'] = array();
|
||||
$buket['url'] = array();
|
||||
$nr = 0;
|
||||
foreach ($this->componentData->version_update as $values)
|
||||
{
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
$buket[$key][] = $value;
|
||||
}
|
||||
}
|
||||
$new = array();
|
||||
$new['id'] = (int) $this->componentID;
|
||||
$new['component_version'] = $this->componentData->component_version;
|
||||
$new['version_update'] = json_encode($buket);
|
||||
$buket['version_update'.$nr] = $values;
|
||||
$nr++;
|
||||
}
|
||||
// update the joomla component table
|
||||
$newJ = array();
|
||||
$newJ['id'] = (int) $this->componentID;
|
||||
$newJ['component_version'] = $this->componentData->component_version;
|
||||
// update the component with the new dynamic SQL
|
||||
$model = ComponentbuilderHelper::getModel('joomla_component');
|
||||
$model->save($new); // <-- to insure the history is also updated
|
||||
$modelJ = ComponentbuilderHelper::getModel('joomla_component');
|
||||
$modelJ->save($newJ); // <-- to insure the history is also updated
|
||||
|
||||
// reset the watch here
|
||||
$this->getHistoryWatch('joomla_component', $this->componentID);
|
||||
|
||||
// update the component update table
|
||||
$newU = array();
|
||||
$newU['id'] = (int) $this->componentData->version_update_id;
|
||||
$newU['version_update'] = json_encode($buket);
|
||||
// update the component with the new dynamic SQL
|
||||
$modelU = ComponentbuilderHelper::getModel('component_updates');
|
||||
$modelU->save($newU); // <-- to insure the history is also updated
|
||||
}
|
||||
}
|
||||
|
||||
@ -3253,11 +3258,11 @@ class Interpretation extends Fields
|
||||
|
||||
public function setDocumentMetadata(&$view)
|
||||
{
|
||||
if ($view['settings']->main_get->gettype == 1 && $view['metadata'] == 1)
|
||||
if ($view['settings']->main_get->gettype == 1 && isset($view['metadata']) && $view['metadata'] == 1)
|
||||
{
|
||||
return $this->setMetadataItem();
|
||||
}
|
||||
elseif ($view['metadata'] == 1)
|
||||
elseif (isset($view['metadata']) && $view['metadata'] == 1)
|
||||
{
|
||||
// lets check if we have a custom get method that has the same name as the view
|
||||
// if we do then it posibly can be that the metadata is loaded via that method
|
||||
@ -5419,6 +5424,10 @@ class Interpretation extends Fields
|
||||
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_STATE'] = "- Keep Original State -";
|
||||
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_ACCESS'] = "- Keep Original Access -";
|
||||
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_CATEGORY'] = "- Keep Original Category -";
|
||||
$this->langContent['admin'][$this->langPrefix.'_PUBLISHED'] = 'Published';
|
||||
$this->langContent['admin'][$this->langPrefix.'_INACTIVE'] = 'Inactive';
|
||||
$this->langContent['admin'][$this->langPrefix.'_ARCHIVED'] = 'Archived';
|
||||
$this->langContent['admin'][$this->langPrefix.'_TRASHED'] = 'Trashed';
|
||||
if ($this->componentData->add_license && $this->componentData->license_type == 3)
|
||||
{
|
||||
$this->langContent['admin']['NIE_REG_NIE'] = "<br /><br /><center><h1>Lincense not set for ".$componentName.".</h1><p>Notify your administrator!<br />The lincense can be obtained from ".$this->componentData->companyname.".</p></center>";
|
||||
@ -7098,32 +7107,32 @@ class Interpretation extends Fields
|
||||
}
|
||||
$counter = $counter + 2;
|
||||
$data_value = (3 == $this->footableVersion) ? 'data-sort-value':'data-value';
|
||||
// add the defaults
|
||||
// add the defaults
|
||||
$body .= PHP_EOL."\t\t<?php if (\$item->published == 1):?>";
|
||||
$body .= PHP_EOL."\t\t\t".'<td class="center" '.$data_value.'="1">';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-published" title="<?php echo JText::_('."'PUBLISHED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'PUBLISHED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-published" title="<?php echo JText::_('."'".$this->langPrefix."_PUBLISHED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'".$this->langPrefix."_PUBLISHED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'</span>';
|
||||
$body .= PHP_EOL."\t\t\t".'</td>';
|
||||
|
||||
$body .= PHP_EOL."\t\t<?php elseif (\$item->published == 0):?>";
|
||||
$body .= PHP_EOL."\t\t\t".'<td class="center" '.$data_value.'="2">';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-inactive" title="<?php echo JText::_('."'INACTIVE'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'INACTIVE'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-inactive" title="<?php echo JText::_('."'".$this->langPrefix."_INACTIVE'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'".$this->langPrefix."_INACTIVE'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'</span>';
|
||||
$body .= PHP_EOL."\t\t\t".'</td>';
|
||||
|
||||
$body .= PHP_EOL."\t\t<?php elseif (\$item->published == 2):?>";
|
||||
$body .= PHP_EOL."\t\t\t".'<td class="center" '.$data_value.'="3">';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-archived" title="<?php echo JText::_('."'ARCHIVED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'ARCHIVED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-archived" title="<?php echo JText::_('."'".$this->langPrefix."_ARCHIVED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'".$this->langPrefix."_ARCHIVED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'</span>';
|
||||
$body .= PHP_EOL."\t\t\t".'</td>';
|
||||
|
||||
$body .= PHP_EOL."\t\t<?php elseif (\$item->published == -2):?>";
|
||||
$body .= PHP_EOL."\t\t\t".'<td class="center" '.$data_value.'="4">';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-trashed" title="<?php echo JText::_('."'ARCHIVED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'ARCHIVED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'<span class="status-metro status-trashed" title="<?php echo JText::_('."'".$this->langPrefix."_TRASHED'".'); ?>">';
|
||||
$body .= PHP_EOL."\t\t\t\t\t".'<?php echo JText::_('."'".$this->langPrefix."_TRASHED'".'); ?>';
|
||||
$body .= PHP_EOL."\t\t\t\t".'</span>';
|
||||
$body .= PHP_EOL."\t\t\t".'</td>';
|
||||
$body .= PHP_EOL."\t\t".'<?php endif; ?>';
|
||||
@ -11570,7 +11579,7 @@ class Interpretation extends Fields
|
||||
$name_list = ComponentbuilderHelper::safeString($view['settings']->name_list);
|
||||
|
||||
$icons .= $this->addCustomDashboardIcons($view,$counter);
|
||||
if ($view['dashboard_add'] == 1)
|
||||
if (isset($view['dashboard_add']) && $view['dashboard_add'] == 1)
|
||||
{
|
||||
$type = ComponentbuilderHelper::imageInfo($view['settings']->icon_add);
|
||||
if ($type)
|
||||
@ -11999,7 +12008,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
// set custom menu
|
||||
$menus .= $this->addCustomSubMenu($view,$codeName,$lang);
|
||||
if ($view['submenu'] == 1)
|
||||
if (isset($view['submenu']) && $view['submenu'] == 1)
|
||||
{
|
||||
// setup access defaults
|
||||
$tab = "";
|
||||
@ -12213,7 +12222,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
// set custom menu
|
||||
$menus .= $this->addCustomMainMenu($view,$codeName,$lang);
|
||||
if ($view['mainmenu'] == 1)
|
||||
if (isset($view['mainmenu']) && $view['mainmenu'] == 1)
|
||||
{
|
||||
$nameList = ComponentbuilderHelper::safeString($view['settings']->name_list);
|
||||
$nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U');
|
||||
|
@ -227,7 +227,7 @@ class Infusion extends Interpretation
|
||||
$viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single);
|
||||
$viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list);
|
||||
// set site edit view array
|
||||
if ($view['edit_create_site_view'])
|
||||
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
||||
{
|
||||
$site_edit_view_array[] = "\t\t\t\t'".$viewName_single."'";
|
||||
$this->lang = 'both';
|
||||
@ -379,7 +379,7 @@ class Infusion extends Interpretation
|
||||
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = '';
|
||||
}
|
||||
// add css to front end
|
||||
if ($view['edit_create_site_view'])
|
||||
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
||||
{
|
||||
$this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###']
|
||||
= $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'];
|
||||
@ -603,7 +603,7 @@ class Infusion extends Interpretation
|
||||
}
|
||||
$this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($viewName_single, $viewName_list);
|
||||
|
||||
if ($view['edit_create_site_view'])
|
||||
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
||||
{
|
||||
// add needed router stuff for front edit views
|
||||
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false);
|
||||
|
Reference in New Issue
Block a user