Пример #1
0
            break;
        }
    }
}
$aMenuSection[$sMenuSection]['active'] = 1;
// ** FOR 'AJAX' REQUESTS ;
if (bx_get('action') !== false) {
    switch (bx_get('action')) {
        case 'edit_form':
            $id = (int) bx_get('id');
            header('Content-Type: text/html; charset=utf-8');
            $aItem = db_assoc_arr("SELECT * FROM `sys_menu_member` WHERE `ID` = {$id}", 0);
            $sResponce = $aItem ? showEditForm($aItem, $sMenuSection) : echoMenuEditMsg('Error', 'red');
            break;
        case 'create_item':
            $newID = createNewElement($_POST['type'], (int) $_POST['source'], $sMenuSection);
            $sResponce = $newID;
            break;
        case 'deactivate_item':
            $res = db_res("UPDATE `sys_menu_member` SET `Active`='0' WHERE `ID`=" . (int) bx_get('id'));
            $sResponce = db_affected_rows();
            break;
        case 'save_item':
            $id = (int) $_POST['id'];
            if (!$id) {
                $sResponce = echoMenuEditMsg('Error', 'red');
            } else {
                $aItemFields = array('Name', 'Caption', 'Link', 'Target', 'Icon', 'Script');
                $aItem = array();
                foreach ($aItemFields as $field) {
                    $aItem[$field] = isset($_POST[$field]) ? $_POST[$field] : null;
Пример #2
0
$logged['admin'] = member_auth(1, true, true);
$GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_mbuilder_Sorry_could_not_insert_object', '_adm_mbuilder_This_items_are_non_editable'));
bx_import('BxDolMenuService');
$oMenu = new BxDolMenuService();
$sResponce = null;
// ** FOR 'AJAX' REQUESTS ;
if (bx_get('action') !== false) {
    switch (bx_get('action')) {
        case 'edit_form':
            $id = (int) bx_get('id');
            header('Content-Type: text/html; charset=utf-8');
            $aItem = db_assoc_arr("SELECT * FROM `" . $oMenu->sDbTable . "` WHERE `ID` = {$id}", 0);
            $sResponce = $aItem ? showEditForm($aItem) : echoMenuEditMsg('Error', 'red');
            break;
        case 'create_item':
            $sResponce = createNewElement($_POST['type'], (int) $_POST['source']);
            break;
        case 'deactivate_item':
            $res = db_res("UPDATE `" . $oMenu->sDbTable . "` SET `Active`='0' WHERE `ID`=" . (int) bx_get('id'));
            $sResponce = db_affected_rows($res);
            break;
        case 'save_item':
            $id = (int) $_POST['id'];
            if (!$id) {
                $sResponce = echoMenuEditMsg('Error', 'red');
                break;
            }
            $aItemFields = array('Name', 'Caption', 'Icon', 'Link', 'Script', 'Target');
            $aItem = array();
            foreach ($aItemFields as $field) {
                $aItem[$field] = isset($_POST[$field]) ? $_POST[$field] : null;
Пример #3
0
             echo showEditFormCustom($aItem);
         } else {
             echo echoMenuEditMsg(_t('_Error'), 'red');
         }
     } else {
         $id = $id - 1000;
         $aItem = db_assoc_arr("SELECT * FROM `sys_menu_admin` WHERE `id` = '{$id}' AND `parent_id`='0'", 0);
         if ($aItem) {
             echo showEditFormTop($aItem);
         } else {
             echo echoMenuEditMsg(_t('_Error'), 'red');
         }
     }
     exit;
 case 'create_item':
     $newID = createNewElement($_POST['type'], (int) $_POST['source']);
     echo $newID;
     exit;
 case 'deactivate_item':
     $id = (int) bx_get('id');
     if ($id > 1000) {
         $id = $id - 1000;
         $res = db_res("DELETE FROM `sys_menu_admin` WHERE `id`='{$id}' AND `parent_id`='0'");
         echo db_affected_rows($res);
     } else {
         echo 1;
     }
     exit;
 case 'save_item':
     $id = (int) $_POST['id'];
     if (!$id) {
         $aItem['Deletable'] = false;
         if ($aItem['Func'] == 'Echo') {
             $aItem['Deletable'] = true;
         } else {
             $iTypeNum = (int) db_value("SELECT COUNT( * ) FROM `{$sTableName}` WHERE `Func` = '{$aItem['Func']}'");
             if ($iTypeNum > 1) {
                 $aItem['Deletable'] = true;
             }
         }
         showEditForm($aItem);
     } else {
         echoMenuEditMsg('Error', 'red');
     }
     exit;
 case 'create_item':
     $newID = createNewElement((int) $_GET['source']);
     echo $newID;
     exit;
 case 'deactivate_item':
     echo "OK";
     //moved it to Col 0
     exit;
 case 'save_item':
     $id = (int) $_POST['id'];
     if (!$id) {
         echoMenuEditMsg('Error', 'red');
         exit;
     }
     $aItemFields = array('Title', 'Caption', 'Content');
     $aItem = array();
     foreach ($aItemFields as $field) {
Пример #5
0
function png2Votab($urlPng, $missions, $start, $stop, $ID)
{
    $xmlPng = new DOMDocument();
    // VOTABLE node
    $votable = $xmlPng->createElementNS('http://www.ivoa.net/xml/VOTable/v1.1', 'VOTABLE');
    $xmlPng->appendChild($votable);
    $voVersion = $xmlPng->createAttribute('version');
    $votable->appendChild($voVersion);
    $voVersionVal = $xmlPng->createTextNode('1.1');
    $voVersion->appendChild($voVersionVal);
    // DESCRIPTION
    $voDescription = $xmlPng->createElement('DESCRIPTION', 'Plot generated by AMDA @ CDPP');
    $votable->appendChild($voDescription);
    // RESOURCE
    $voResource = $xmlPng->createElement('RESOURCE');
    $votable->appendChild($voResource);
    // DESCRIPTION RESOURCE
    $voResource->appendChild($voDescription);
    // INFO
    // Creation Date
    $infoCreationDate = createNewElement($xmlPng, 'INFO', array('name' => 'CreationDate', 'value' => date("c"), 'ucd' => 'meta.code', 'xtype' => 'iso8601', 'utype' => 'helio:time.time_creation'));
    $voResource->appendChild($infoCreationDate);
    // Mission
    for ($i = 0; $i < count($missions); $i++) {
        $missionsString = $missionsString . $missions[$i];
        if ($i !== count($missions) - 1) {
            $missionsString = $missionsString . ',';
        }
    }
    $infoMissions = createNewElement($xmlPng, 'INFO', array('name' => 'Missions', 'value' => $missionsString, 'ucd' => 'meta.code', 'xtype' => 'TODO ask Anja'));
    $voResource->appendChild($infoMissions);
    //  TimeRange
    $infoTimeRange = createNewElement($xmlPng, 'INFO', array('name' => 'TIME_RANGE', 'value' => 'FROM:' . implode($start) . ' TO:' . implode($stop)));
    $voResource->appendChild($infoTimeRange);
    // TABLE
    $table = createNewElement($xmlPng, 'TABLE', array('name' => $missionsString . '_PLOT'));
    $voResource->appendChild($table);
    // FIELD
    $field = createNewElement($xmlPng, 'FIELD', array('datatype' => 'char', 'name' => 'url', 'arraysize' => '*'));
    $table->appendChild($field);
    // FIELD DESCRIPTION
    $description2 = $xmlPng->createElement('DESCRIPTION', 'URL of the DES PLOT file');
    $field->appendChild($description2);
    // DATA
    $data = $xmlPng->createElement('DATA');
    $field->appendChild($data);
    // TABLEDATA
    $tabledata = $xmlPng->createElement('TABLEDATA');
    $data->appendChild($tabledata);
    // TR
    $tr = $xmlPng->createElement('TR');
    $tabledata->appendChild($tr);
    // TD
    $td = $xmlPng->createElement('TD', $urlPng);
    $tr->appendChild($td);
    $xmlPng->save(finalDir . $ID . ".xml");
    // 	$xmlPng->save("/home/budnik/Amda-Helio/DDHTML/WebServices/TEST/testVOtablePnj.xml");
}