/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editModule($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosModule($database);
    // load the row from the db table
    $row->load((int) $uid);
    // fail if checked out not by 'me'
    if ($row->isCheckedOut($my->id)) {
        mosErrorAlert("The module " . $row->title . " is currently being edited by another administrator");
    }
    $row->content = htmlspecialchars($row->content);
    if ($uid) {
        $row->checkout($my->id);
    }
    // if a new record we must still prime the mosModule object with a default
    // position and the order; also add an extra item to the order list to
    // place the 'new' record in last position if desired
    if ($uid == 0) {
        $row->position = 'left';
        $row->showtitle = true;
        //$row->ordering = $l;
        $row->published = 1;
    }
    if ($client == 'admin') {
        $where = "client_id = 1";
        $lists['client_id'] = 1;
        $path = 'mod1_xml';
    } else {
        $where = "client_id = 0";
        $lists['client_id'] = 0;
        $path = 'mod0_xml';
    }
    $query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE {$where}" . "\n ORDER BY ordering";
    $database->setQuery($query);
    if (!($orders = $database->loadObjectList())) {
        echo $database->stderr();
        return false;
    }
    $query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position != ''" . "\n ORDER BY position";
    $database->setQuery($query);
    // hard code options for now
    $positions = $database->loadObjectList();
    $orders2 = array();
    $pos = array();
    foreach ($positions as $position) {
        $orders2[$position->position] = array();
        $pos[] = mosHTML::makeOption($position->position, $position->description);
    }
    $l = 0;
    $r = 0;
    for ($i = 0, $n = count($orders); $i < $n; $i++) {
        $ord = 0;
        if (array_key_exists($orders[$i]->position, $orders2)) {
            $ord = count(array_keys($orders2[$orders[$i]->position])) + 1;
        }
        $orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title));
    }
    // build the html select list
    $pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"';
    $active = $row->position ? $row->position : 'left';
    $lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active);
    // get selected pages for $lists['selections']
    if ($uid) {
        $query = "SELECT menuid AS value" . "\n FROM #__modules_menu" . "\n WHERE moduleid = " . (int) $row->id;
        $database->setQuery($query);
        $lookup = $database->loadObjectList();
    } else {
        $lookup = array(mosHTML::makeOption(0, 'All'));
    }
    if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) {
        $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />';
        $lists['showtitle'] = 'N/A <input type="hidden" name="showtitle" value="1" />';
        $lists['selections'] = 'N/A';
    } else {
        if ($client == 'admin') {
            $lists['access'] = 'N/A';
            $lists['selections'] = 'N/A';
        } else {
            $lists['access'] = mosAdminMenus::Access($row);
            $lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1);
        }
        $lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle);
    }
    // build the html select list for published
    $lists['published'] = mosAdminMenus::Published($row);
    $row->description = '';
    // XML library
    require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php';
    // xml file for module
    $xmlfile = $mainframe->getPath($path, $row->module);
    $xmlDoc = new DOMIT_Lite_Document();
    $xmlDoc->resolveErrors(true);
    if ($xmlDoc->loadXML($xmlfile, false, true)) {
        $root =& $xmlDoc->documentElement;
        if ($root->getTagName() == 'mosinstall' && $root->getAttribute('type') == 'module') {
            $element =& $root->getElementsByPath('description', 1);
            $row->description = $element ? trim($element->getText()) : '';
        }
    }
    // get params definitions
    $params = new mosParameters($row->params, $xmlfile, 'module');
    HTML_modules::editModule($row, $orders2, $lists, $params, $option);
}
Exemple #2
0
/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editMambot($option, $uid, $client)
{
    global $database, $my, $mainframe, $adminLanguage;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosMambot($database);
    // load the row from the db table
    $row->load($uid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        echo "<script>alert(\"" . $adminLanguage->A_COMP_CONTENT_MODULE . " " . $row->title . " " . $adminLanguage->A_COMP_MAMB_EDIT . "\"); document.location.href='index2.php?option={$option}'</script>\n";
        exit(0);
    }
    if ($uid) {
        $row->checkout($my->id);
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
    } else {
        $where = "client_id='0'";
    }
    if (!$uid) {
        $row->folder = '';
        $row->ordering = 999;
        $row->published = 1;
    }
    // get list of groups
    if ($row->access == 99 || $row->client_id == 1) {
        $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />';
    } else {
        // build the html select list for the group access
        $lists['access'] = mosAdminMenus::Access($row);
    }
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    if ($uid) {
        if ($row->ordering > -10000 && $row->ordering < 10000) {
            // build the html select list for ordering
            $query = "SELECT ordering AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='{$row->folder}'" . "\n AND published > 0" . "\n AND {$where}" . "\n AND ordering > -10000" . "\n AND ordering < 10000" . "\n ORDER BY ordering";
            $order = mosGetOrderingList($query);
            $lists['ordering'] = mosHTML::selectList($order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->ordering));
        } else {
            $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />This mambot cannot be reordered';
        }
        $lists['folder'] = '<input type="hidden" name="folder" value="' . $row->folder . '" />' . $row->folder;
    } else {
        $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />New items default to the last place';
        $folders = mosReadDirectory($mosConfig_absolute_path . '/mambots/');
        $folders2 = array();
        foreach ($folders as $folder) {
            if (is_dir($mosConfig_absolute_path . '/mambots/' . $folder)) {
                $folders2[] = mosHTML::makeOption($folder);
            }
        }
        $lists['folder'] = mosHTML::selectList($folders2, 'folder', 'class="inputbox" size="1"', 'value', 'text', null);
    }
    $row->description = '';
    // XML library
    require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php';
    // xml file for module
    $xmlfile = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/' . $row->element . '.xml';
    $xmlDoc =& new DOMIT_Lite_Document();
    $xmlDoc->resolveErrors(true);
    if ($xmlDoc->loadXML($xmlfile, false, true)) {
        $element =& $xmlDoc->documentElement;
        if ($element->getTagName() == 'mosinstall' && $element->getAttribute('type') == 'mambot') {
            $element =& $xmlDoc->getElementsByPath('description', 1);
            $row->description = $element ? trim($element->getText()) : '';
        }
    }
    // get params definitions
    $params =& new mosParameters($row->params, $mainframe->getPath('bot_xml', $row->folder . '/' . $row->element), 'mambot');
    HTML_modules::editMambot($row, $lists, $params, $option);
}
Exemple #3
0
 function preview()
 {
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('AMM_MODULE_PREVIEW'));
     require_once JApplicationHelper::getPath('admin_html');
     HTML_modules::preview();
 }
Exemple #4
0
/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editModule($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosModule($database);
    // load the row from the db table
    $row->load($uid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        echo "<script>alert('" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "'); document.location.href='index2.php?option={$option}'</script>\n";
        exit(0);
    }
    $row->title = htmlspecialchars(str_replace('&amp;', '&', $row->title));
    $row->content = htmlspecialchars(str_replace('&amp;', '&', $row->content));
    if ($uid) {
        $row->checkout($my->id);
    }
    // if a new record we must still prime the mosModule object with a default
    // position and the order; also add an extra item to the order list to
    // place the 'new' record in last position if desired
    if ($uid == 0) {
        $row->position = 'left';
        $row->showtitle = true;
        //$row->ordering = $l;
        $row->published = 1;
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
        $lists['client_id'] = 1;
        $path = 'mod1_xml';
    } else {
        $where = "client_id='0'";
        $lists['client_id'] = 0;
        $path = 'mod0_xml';
    }
    $query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE " . $where . "\n ORDER BY ordering";
    $database->setQuery($query);
    if (!($orders = $database->loadObjectList())) {
        echo $database->stderr();
        return false;
    }
    $query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position <> ''";
    $database->setQuery($query);
    // hard code options for now
    $positions = $database->loadObjectList();
    $orders2 = array();
    $pos = array();
    foreach ($positions as $position) {
        $orders2[$position->position] = array();
        $pos[] = mosHTML::makeOption($position->position, $position->description);
    }
    $l = 0;
    $r = 0;
    for ($i = 0, $n = count($orders); $i < $n; $i++) {
        $ord = 0;
        if (array_key_exists($orders[$i]->position, $orders2)) {
            $ord = count(array_keys($orders2[$orders[$i]->position])) + 1;
        }
        $orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title));
    }
    // build the html select list
    $pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"';
    $active = $row->position ? $row->position : 'left';
    $lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active);
    // get selected pages for $lists['selections']
    if ($uid) {
        $query = 'SELECT menuid AS value FROM #__modules_menu WHERE moduleid=' . $row->id;
        $database->setQuery($query);
        $lookup = $database->loadObjectList();
    } else {
        $lookup = array(mosHTML::makeOption(0, 'All'));
    }
    if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) {
        $lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />';
        $lists['showtitle'] = T_('N/A') . ' <input type="hidden" name="showtitle" value="1" />';
        $lists['selections'] = T_('N/A');
    } else {
        if ($client == 'admin') {
            $lists['access'] = T_('N/A');
            $lists['selections'] = T_('N/A');
        } else {
            $lists['access'] = mosAdminMenus::Access($row);
            $lists['groups'] = mosAdminMenus::groupAccess($row);
            $lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1);
        }
        $lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle);
    }
    // build the html select list for published
    $lists['published'] = mosAdminMenus::Published($row);
    // xml file for module
    $xmlfile = $mainframe->getPath($path, $row->module);
    if ($xmlfile) {
        $xmlparser =& new mosXMLDescription($xmlfile);
        $row->description = $xmlparser->getDescription('module');
    } else {
        $row->description = '';
    }
    // get params definitions
    $params =& new mosAdminParameters($row->params, $xmlfile, 'module');
    HTML_modules::editModule($row, $orders2, $lists, $params, $option);
}
Exemple #5
0
/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editMambot($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosMambot($database);
    // load the row from the db table
    $row->load($uid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        echo "<script>alert(" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "); document.location.href='index2.php?option={$option}'</script>\n";
        exit(0);
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
    } else {
        $where = "client_id='0'";
    }
    // get list of groups
    if ($row->access == 99 || $row->client_id == 1) {
        $lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />';
    } else {
        // build the html select list for the group access
        $lists['access'] = mosAdminMenus::Access($row);
    }
    if ($uid) {
        $row->checkout($my->id);
        if ($row->ordering > -10000 && $row->ordering < 10000) {
            // build the html select list for ordering
            $query = "SELECT ordering AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='{$row->folder}'" . "\n AND published > 0" . "\n AND {$where}" . "\n AND ordering > -10000" . "\n AND ordering < 10000" . "\n ORDER BY ordering";
            $order = mosGetOrderingList($query);
            $lists['ordering'] = mosHTML::selectList($order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->ordering));
        } else {
            $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />' . T_('This mambot cannot be reordered');
        }
        $lists['folder'] = '<input type="hidden" name="folder" value="' . $row->folder . '" />' . $row->folder;
        // xml file for module
        $xmlfile = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/' . $row->element . '.xml';
        $xmlparser =& new mosXMLDescription($xmlfile);
        $row->description = T_($xmlparser->getDescription('mambot'));
    } else {
        $row->folder = '';
        $row->ordering = 999;
        $row->published = 1;
        $row->description = '';
        $folders = mosReadDirectory($mosConfig_absolute_path . '/mambots/');
        $folders2 = array();
        foreach ($folders as $folder) {
            if (is_dir($mosConfig_absolute_path . '/mambots/' . $folder) && $folder != 'CVS') {
                $folders2[] = mosHTML::makeOption($folder);
            }
        }
        $lists['folder'] = mosHTML::selectList($folders2, 'folder', 'class="inputbox" size="1"', 'value', 'text', null);
        $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />' . T_('New items default to the last place. Ordering can be changed after this item is saved.') . '';
    }
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    // get params definitions
    $params =& new mosAdminParameters($row->params, $mainframe->getPath('bot_xml', $row->folder . '/' . $row->element), 'mambot');
    HTML_modules::editMambot($row, $lists, $params, $option);
}
/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editMambot($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosMambot($database);
    // load the row from the db table
    $row->load((int) $uid);
    // fail if checked out not by 'me'
    if ($row->isCheckedOut($my->id)) {
        mosErrorAlert("O módulo " . $row->title . " está, atualmente, a ser editado por outro administrador");
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
    } else {
        $where = "client_id='0'";
    }
    // get list of groups
    if ($row->access == 99 || $row->client_id == 1) {
        $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />';
    } else {
        // build the html select list for the group access
        $lists['access'] = mosAdminMenus::Access($row);
    }
    if ($uid) {
        $row->checkout($my->id);
        if ($row->ordering > -10000 && $row->ordering < 10000) {
            // build the html select list for ordering
            $query = "SELECT ordering AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder = " . $database->Quote($row->folder) . "\n AND published > 0" . "\n AND {$where}" . "\n AND ordering > -10000" . "\n AND ordering < 10000" . "\n ORDER BY ordering";
            $order = mosGetOrderingList($query);
            $lists['ordering'] = mosHTML::selectList($order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->ordering));
        } else {
            $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />Este plugin não pode ser reordenado';
        }
        $lists['folder'] = '<input type="hidden" name="folder" value="' . $row->folder . '" />' . $row->folder;
        // XML library
        require_once $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php';
        // xml file for module
        $xmlfile = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/' . $row->element . '.xml';
        $xmlDoc = new DOMIT_Lite_Document();
        $xmlDoc->resolveErrors(true);
        if ($xmlDoc->loadXML($xmlfile, false, true)) {
            $root =& $xmlDoc->documentElement;
            if ($root->getTagName() == 'mosinstall' && $root->getAttribute('type') == 'mambot') {
                $element =& $root->getElementsByPath('description', 1);
                $row->description = $element ? trim($element->getText()) : '';
            }
        }
    } else {
        $row->folder = '';
        $row->ordering = 999;
        $row->published = 1;
        $row->description = '';
        $folders = mosReadDirectory($mosConfig_absolute_path . '/mambots/');
        $folders2 = array();
        foreach ($folders as $folder) {
            if (is_dir($mosConfig_absolute_path . '/mambots/' . $folder) && $folder != 'CVS') {
                $folders2[] = mosHTML::makeOption($folder);
            }
        }
        $lists['folder'] = mosHTML::selectList($folders2, 'folder', 'class="inputbox" size="1"', 'value', 'text', null);
        $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />Os novos itens, por padrão, serão adicionados ao final da lista. A ordem pode ser alterada após este item serem salvos.';
    }
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    $path = $mosConfig_absolute_path . "/mambots/{$row->folder}/{$row->element}.xml";
    if (!file_exists($path)) {
        $path = '';
    }
    // get params definitions
    $params = new mosParameters($row->params, $path, 'mambot');
    HTML_modules::editMambot($row, $lists, $params, $option);
}
    /**
     * Writes the edit form for new and existing module
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param JTableCategory The category object
     * @param array <p>The modules of the left side.  The array elements are in the form
     * <var>$leftorder[<i>order</i>] = <i>label</i></var>
     * where <i>order</i> is the module order from the db table and <i>label</i> is a
     * text label associciated with the order.</p>
     * @param array See notes for leftorder
     * @param array An array of select lists
     * @param object Parameters
     */
    function edit(&$model, &$row, &$orders2, &$lists, &$params, $client)
    {
        JRequest::setVar('hidemainmenu', 1);
        // clean item data
        JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'content');
        if ($client->id != 1) {
            $parameters =& NNParameters::getParameters();
            $config = JComponentHelper::getParams('com_advancedmodules');
            $config = $parameters->getParams($config->_raw, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
        }
        $document =& JFactory::getDocument();
        $editor =& JFactory::getEditor();
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php';
        $version = NoNumberVersions::getXMLVersion(null, null, null, 1);
        $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js' . $version);
        $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/elements/toggler.js' . $version);
        $script = "\n\t\t\tfunction submitbutton( pressbutton ) {\n\t\t\t\tif ( ( pressbutton == 'save' || pressbutton == 'apply' ) && ( document.adminForm.title.value == '' ) ) {\n\t\t\t\t\talert( '" . JText::_('Module must have a title', true) . "' );\n\t\t\t\t} else {\n\t\t\t\t\tif ( pressbutton == 'save' ) {\n\t\t\t\t\t\tdocument.adminForm.target = '_parent';\n\t\t\t\t\t}\n\t\t";
        if ($row->module == '' || $row->module == 'mod_custom') {
            $script .= $editor->save('content');
        }
        $script .= "\n\t\t\t\t\tsubmitform( pressbutton );\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar originalOrder \t= '" . $row->ordering . "';\n\t\t\tvar originalPos \t= '" . $row->position . "';\n\t\t\tvar orders \t\t\t= new Array();\t// array in the format [key,value,text]\n\t\t";
        $i = 0;
        foreach ($orders2 as $k => $items) {
            foreach ($items as $v) {
                $script .= "\n" . '	orders[' . $i++ . '] = new Array( "' . $k . '","' . $v->value . '","' . $v->text . '" );';
            }
        }
        $script .= "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tif ( !nnTogglerSet ) {\n\t\t\t\t\tnnTogglerSet = new nnToggler();\n\t\t\t\t}\n\t\t\t});\n\t\t";
        if ($client->id != 1) {
            if ($config->show_color) {
                $colors = explode(',', $config->main_colors);
                foreach ($colors as $i => $c) {
                    $colors[$i] = strtoupper('#' . preg_replace('#[^a-z0-9]#i', '', $c));
                }
                $script .= "\n\t\t\t\t\tmainColors = new Array( '" . implode("', '", $colors) . "' );";
            }
        }
        $document->addScriptDeclaration($script);
        $tmpl = JRequest::getCmd('tmpl');
        if ($tmpl == 'component') {
            HTML_modules::placeModalHeader('edit');
        }
        jimport('joomla.html.pane');
        // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
        $pane =& JPane::getInstance('sliders', array('allowAllClose' => true));
        JHTML::_('behavior.tooltip');
        ?>
		<form action="<?php 
        echo JRoute::_('index.php');
        ?>
" method="post" name="adminForm">
			<input type="hidden" name="option" value="com_advancedmodules" />
			<input type="hidden" name="tmpl" value="<?php 
        echo $tmpl;
        ?>
" />
			<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="cid[]" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="original" value="<?php 
        echo $row->ordering;
        ?>
" />
			<input type="hidden" name="module" value="<?php 
        echo $row->module;
        ?>
" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="client" value="<?php 
        echo $client->id;
        ?>
" />
			<?php 
        echo JHTML::_('form.token');
        ?>

		<div class="col width-50">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('Details');
        ?>
</legend>

				<table class="admintable" cellspacing="1">
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Module Type');
        ?>
:
						</td>
						<td>
							<strong>
								<?php 
        echo JText::_($row->module);
        ?>
							</strong>
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="title">
								<?php 
        echo JText::_('Title');
        ?>
:
							</label>
						</td>
						<td>
							<input class="text_area" type="text" name="title" id="title" size="50" value="<?php 
        echo $row->title;
        ?>
" />
						</td>
					</tr>
					<tr>
						<td width="100" class="key">
							<?php 
        echo JText::_('Show title');
        ?>
:
						</td>
						<td>
							<?php 
        echo $lists['showtitle'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Published');
        ?>
:
						</td>
						<td>
							<?php 
        echo $lists['published'];
        ?>
						</td>
					</tr>
				<?php 
        if ($client->id != 1) {
            if ($config->show_hideempty) {
                ?>
					<tr>
						<td valign="top" class="key">
							<label for="hideempty" class="hasTip" title="<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY');
                ?>
::<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY_DESC');
                ?>
">
								<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY', 0);
                ?>
:
							</label>
						</td>
						<td>
							<?php 
                echo $lists['hideempty'];
                ?>
						</td>
					</tr>
				<?php 
            }
        }
        ?>
					<tr>
						<td valign="top" class="key">
							<label for="position" class="hasTip" title="<?php 
        echo JText::_('MODULE_POSITION_TIP_TITLE', true);
        ?>
::<?php 
        echo JText::_('MODULE_POSITION_TIP_TEXT', true);
        ?>
">
								<?php 
        echo JText::_('Position');
        ?>
:
							</label>
						</td>
						<td>
							<input type="text" id="position" name="position" value="<?php 
        echo $row->position;
        ?>
"  onchange="form.position_select.value=this.value" />
							<select id="position_select" onchange="document.getElementById('position').value=this.options[this.selectedIndex].value;this.value=''" style="background-color:#F0F0F0;">
							<?php 
        echo '<option value="">-- ' . JText::_('Select Position') . ' --</option>';
        $positions = $model->getPositions();
        foreach ($positions as $position) {
            echo '<option value="' . $position . '">' . $position . '</option>';
        }
        ?>
							</select>
						</td>
					</tr>

					<tr>
						<td valign="top"  class="key">
							<label for="ordering">
								<?php 
        echo JText::_('Order');
        ?>
:
							</label>
						</td>
						<td>
							<script language="javascript" type="text/javascript">
							<!--
							writeDynaList( 'class="inputbox" name="ordering" id="ordering" size="1"', orders, originalPos, originalPos, originalOrder );
							//-->
							</script>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<label for="access">
								<?php 
        echo JText::_('AMM_ACCESS_LEVEL');
        ?>
:
							</label>
						</td>
						<td>
							<?php 
        echo $lists['access'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('ID');
        ?>
:
						</td>
						<td>
							<?php 
        echo $row->id;
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Description');
        ?>
:
						</td>
						<td>
							<?php 
        echo JText::_(html_entity_decode($row->description, ENT_COMPAT, 'UTF-8'));
        ?>
						</td>
					</tr>
				<?php 
        if ($client->id != 1) {
            ?>
					<tr>
						<td valign="top" class="key">
							<label class="hasTip" title="<?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION');
            ?>
::<?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION_DESC');
            ?>
"><?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION');
            ?>
:</label>
						</td>
						<td>
							<?php 
            echo $lists['tooltip'];
            ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<label class="hasTip" title="<?php 
            echo JText::_('AMM_COLOR');
            ?>
::<?php 
            echo JText::_('AMM_COLOR_DESC');
            ?>
"><?php 
            echo JText::_('AMM_COLOR');
            ?>
:</label>
						</td>
						<td>
							<?php 
            echo $lists['color'];
            ?>
						</td>
					</tr>
				<?php 
        }
        ?>
				</table>
			</fieldset>
		</div>

		<div class="col width-50">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('Parameters');
        ?>
</legend>

				<?php 
        echo $pane->startPane("menu-pane");
        echo $pane->startPanel(JText::_('Module Parameters'), "param-page");
        $p = $params;
        $params = $p->render('params');
        if ($params) {
            echo $params;
            if ($client->id != 1) {
                echo $lists['extra'];
            }
        } else {
            if ($client->id != 1 && $lists['extra']) {
                echo $lists['extra'];
            } else {
                echo "<div style=\"text-align: center; padding: 5px; \">" . JText::_('There are no parameters for this item') . "</div>";
            }
        }
        echo $pane->endPanel();
        if ($p->getNumParams('advanced')) {
            echo $pane->startPanel(JText::_('Advanced Parameters'), "advanced-page");
            $params = $p->render('params', 'advanced');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no advanced parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($p->getNumParams('legacy')) {
            echo $pane->startPanel(JText::_('Legacy Parameters'), "legacy-page");
            $params = $p->render('params', 'legacy');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no legacy parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($p->getNumParams('other')) {
            echo $pane->startPanel(JText::_('Other Parameters'), "other-page");
            $params = $p->render('params', 'other');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no other parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($client->id != 1) {
            echo $pane->startPanel(JText::_('AMM_MODULE_ASSIGNMENT'), "assignment-page");
            echo HTML_modules::renderAssignments($lists, $config);
            echo $pane->endPanel();
        }
        echo $pane->endPane();
        ?>
			</fieldset>
		</div>
		<div class="clr"></div>

		<?php 
        if (!$row->module || $row->module == 'custom' || $row->module == 'mod_custom') {
            ?>
			<fieldset class="adminform">
				<legend><?php 
            echo JText::_('Custom Output');
            ?>
</legend>

				<?php 
            // parameters : areaname, content, width, height, cols, rows
            echo $editor->display('content', $row->content, '100%', '400', '60', '20', array('pagebreak', 'readmore'));
            ?>

			</fieldset>
			<?php 
        }
        ?>
		</form>
	<?php 
    }