/** * ask if the user really wants to update core field structure */ function confirmElementUpdate() { $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel'); $className = JRequest::getVar('plugin', 'fabrikfield'); $model =& $pluginManager->getPlugIn($className, 'element'); $model->setId(JRequest::getInt('id', 0, 'request')); require_once JPATH_COMPONENT . DS . 'views' . DS . 'element.php'; FabrikViewElement::confirmElementUpdate($model); }
function confirmElementUpdate(&$model) { $session =& JFactory::getSession(); JRequest::setVar('hidemainmenu', 1); FabrikViewElement::setUpdateConfirmElementToolbar(); $element = $model->getElement(); $db =& JFactory::getDBO(); $tableModel =& $model->getTableModel(); $config =& JFactory::getConfig(); $prefix = $config->getValue('dbprefix'); $tablename = $tableModel->getTable()->db_table_name; $hasprefix = strstr($tablename, $prefix) === false ? false : true; $tablename = str_replace($prefix, '#__', $tablename); $origDesc = $session->get('com_fabrik.admin.element.origdesc'); $core = array('#__banner', '#__bannerclient', '#__bannertrack', '#__categories', '#__components', '#__contact_details', '#__content', '#__content_frontpage', '#__content_rating', '#__core_acl_aro', '#__core_acl_aro_groups', '#__core_acl_aro_map', '#__core_acl_aro_sections', '#__core_acl_groups_aro_map', '#__core_log_items', '#__core_log_searches', '#__fabrik_calendar_events', '#__fabrik_connections', '#__fabrik_elements', '#__fabrik_formgroup', '#__fabrik_forms', '#__fabrik_groups', '#__fabrik_joins', '#__fabrik_jsactions', '#__fabrik_packages', '#__fabrik_plugins', '#__fabrik_tables', '#__fabrik_validations', '#__fabrik_visualizations', '#__groups', '#__menu', '#__menu_types', '#__messages', '#__messages_cfg', '#__migration_backlinks', '#__modules', '#__modules_menu', '#__newsfeeds', '#__plugins', '#__poll_data', '#__poll_date', '#__poll_menu', '#__polls', '#__sections', '#__session', '#__stats_agents', '#__templates_menu', '#__users', '#__weblinks'); if (in_array($tablename, $core)) { JError::raiseNotice(E_WARNING, 'The table you are updating is a core Joomla or Fabrik table'); } else { if ($hasprefix) { JError::raiseNotice(E_WARNING, 'The table you are updating to has a prefix of "jos_", whilst it is not a core Joomla or Fabrik table, it may well be used by other components'); } } $newDesc = $session->get('com_fabrik.admin.element.newdesc'); $oldName = $session->get('com_fabrik.admin.element.oldname'); $origPlugin = JRequest::getVar('origplugin'); ?> <form name="adminForm" method="post" action="index.php"> <ul style="list-style:none;font-weight:bold;color:#0055BB;background:#C3D2E5 url(templates/khepri/images/notice-info.png) no-repeat scroll 4px center;padding:10px;margin-bottom:10px;border-top:3px solid #84A7DB;border-bottom:3px solid #84A7DB"> <?php if ($db->NameQuote($element->name) !== $oldName) { ?> <li style="padding-left:30px"><?php echo JText::sprintf('UPDATEELEMENTNAME', $oldName, $db->NameQuote($element->name)); ?> </li> <?php } ?> <?php if (strtolower($origDesc) !== strtolower($newDesc)) { ?> <li style="padding-left:30px"><?php echo JText::sprintf('UPDATEELEMENTSTRUCTURE', $origDesc, $newDesc); ?> </li> <?php } ?> </ul> <?php echo JText::_('UPDATEFIELDSTRUCTUREDESC'); ?> <input type="hidden" name="option" value="com_fabrik" /> <input type="hidden" name="c" value="element" /> <input type="hidden" name="task" value="elementUpdate" /> <input type="hidden" name="id" value="<?php echo $element->id; ?> " /> <input type="hidden" name="origtaks" value="<?php echo JRequest::getVar('origtaks'); ?> " /> <input type="hidden" name="oldname" value="<?php echo $oldName; ?> " /> <input type="hidden" name="origplugin" value="<?php echo $origPlugin; ?> " /> <?php echo JHTML::_('form.token'); echo JHTML::_('behavior.keepalive'); ?> </form> <?php }