$security = $wo->db->getSecurityPermitionsForLocationAndUser($address, $userData['id']); if (!isset($security[$action]) || $security[$action] != true) { //die('Δεν έχετε την απαιτούμενη έγκριση ασφάλειας για να προβείτε σε αυτή την ενέργεια. Θα πρέπει να κάνετε login με άλλο λογαριασμό για να προχωρήσετε.<br/>Αυτό το σφάλμα μπορεί να συμβεί επίσης αν ζητήσετε μια ενέργεια που δεν έχει οριστεί.'); $wo->handleShowStopperError('You are not authorised for this action. Please login with an admin account.'); } else { $addressItems = explode('_', $address); if (count($addressItems) < 2 || $addressItems[0] != '1') { //$wo->reportError('Η διεύθυνση που δώσατε είναι εσφαλμένη. Δεν βρέθηκε το κατάλληλο descriptor.'); $wo->handleShowStopperError('Wrong authorisation location.'); } $table = new WOOOF_dataBaseTable($wo->db, '', $addressItems[1]); if ($action == 'read' && count($addressItems) == 2) { if ($table->getAdminPresentation() == '4') { $table2 = new WOOOF_dataBaseTable($wo->db, $table->getGroupedByTable()); if (!isset($_GET[$table->getLocalGroupColumn()]) || $_GET[$table->getLocalGroupColumn()] == '') { if ($table2->getOrderingColumnForListings() != '') { $orderBy = $table2->getOrderingColumnForListings(); } else { $orderBy = 'id'; } $table2->getResult('', $orderBy, '', 1); $_GET[$table->getLocalGroupColumn()] = $table2->resultRows[0]['id']; } else { $_GET[$table->getLocalGroupColumn()] = $wo->cleanUserInput($_GET[$table->getLocalGroupColumn()]); } foreach ($table2->columns as $key => $value) { $column = $value->getColumnMetaData(); if ($column['appearsInLists']) { $columnsToShow = $column['name']; } }
foreach ($table->columns as $key => $value) { $column = $value->getColumnMetaData(); if ($column['appearsInLists']) { $columnsToShow = $column['name']; } } if (count($addressItems) == 2 || $addressItems[2] == '') { $whereClauses['parent_id'] = '-1'; $table->getResult($whereClauses, 'ord'); //$innerStuff ='<div id="listTitle"><a href="administration.php?action=edit&__address=1_'. $table->getTableId() .'_&wooofParent=-1">Προσθήκη '. $table->getTableDescription() .'</a></div>'; $actualRow['name'] = 'Μενού'; $additionLabel = '<a href="administration.php?action=edit&__address=1_' . $table->getTableId() . '_&wooofParent=-1">Προσθήκη ' . $table->getTableDescription() . '</a>'; } else { $actualRow = $wo->db->getRow($table->getTableName(), $addressItems[2]); $whereClauses['parent_id'] = $addressItems[2]; $table->getResult($whereClauses, $table->getOrderingColumnForListings()); $current_row['parent_id'] = $addressItems[2]; $treeLevel = 0; do { $treeLevel++; $current_row = $wo->db->getRow($table->getTableName(), $current_row['parent_id']); if ($addressItems[2] == $current_row['id']) { $path = ' > ' . $current_row[$table->columns[$counter]->getName()] . $path; } else { $path = ' > <a href="improvedTree.php?__address=1_' . $table->getTableId() . '_' . $current_row['id'] . '&action=read">' . $current_row[$table->columns[$counter]->getName()] . '</a>' . $path; } } while ($current_row['parent_id'] != '-1'); $path = '<div id="pathDivision"><a href="improvedTree.php?__address=1_' . $table->getTableId() . '&action=read">' . $table->getTableDescription() . '</a>' . $path . '</div>'; $additionLabel = 'Προσθήκη υπομενού στο "' . $actualRow[$columnsToShow] . '"'; } if (isset($actualRow['id']) && trim($actualRow['categoryHandling']) != '') {
/** * * @param array $row * @param string $subTableName * @param string $optionsTableName * @param string $className * @param string $separator * @return false|string */ public function renderSubtableReadOnly($row, $subTableName, $optionsTableName, $className = '', $separator = NULL) { $cssForFormItem = WOOOF::$instance->getConfigurationFor('cssForFormItem'); $templatesRepository = WOOOF::$instance->getConfigurationFor('templatesRepository'); $output = ''; $itemsPerRow = 99999; require $templatesRepository . 'wooof_renderSubtableReadOnly_1.activeTemplate.php'; $subTable = new WOOOF_dataBaseTable($this->dataBase, $subTableName); $optionsTable = new WOOOF_dataBaseTable($this->dataBase, $optionsTableName); if ($subTable->constructedOk === FALSE || $optionsTable->constructedOk === FALSE) { return FALSE; } $res = $optionsTable->getResult('', $optionsTable->getOrderingColumnForListings()); if ($res === FALSE) { return FALSE; } $whereClauses[$subTable->getLocalGroupColumn()] = $row[$subTable->getRemoteGroupColumn()]; $subTable->getResult($whereClauses); if ($subTable === FALSE) { return FALSE; } $howManyItems = count($optionsTable->resultRows) / 2; $howManyRows = ceil($howManyItems / $itemsPerRow); $itemsOut = 0; $howManyItemsSub = count($subTable->resultRows) / 2; $checkBoxName = $subTable->getTableId(); for ($n = 0; $n < count($subTable->columns) / 2; $n++) { $columnMetaData = $subTable->columns[$n]->getColumnMetaData(); if ($columnMetaData['valuesTable'] == $optionsTable->getTableName()) { $presentationColumn = $columnMetaData['name']; $presentationValueColumn = $columnMetaData['columnToStore']; $presentationShowColumn = $columnMetaData['columnToShow']; } } if ($className == '') { $className = $cssForFormItem['checkBox']; } for ($q = 0; $q < $howManyRows; $q++) { for ($z = 0; $z < $itemsPerRow; $z++) { if ($itemsOut < $howManyItems) { $isChecked = FALSE; for ($n = 0; $n < $howManyItemsSub; $n++) { if ($subTable->resultRows[$n][$presentationColumn] == $optionsTable->resultRows[$itemsOut][$presentationValueColumn]) { $isChecked = TRUE; } } if ($isChecked) { require $templatesRepository . 'wooof_renderSubtableReadOnly_2.activeTemplate.php'; } } $itemsOut++; } } return $output . $outputTail; }
$showIdInAdminForms = ''; $dbEngine = ''; } else { if (isset($_GET['table'])) { $table = new WOOOF_dataBaseTable($wo->db, $wo->db->escape(trim($_GET['table']))); $action = 'edit'; $description = $table->getTableDescription(); $subtableDescription = $table->getSubTableDescription(); $presentationDefault[1] = ''; $presentationDefault[2] = ''; $presentationDefault[3] = ''; $presentationDefault[4] = ''; $presentationDefault[5] = ''; $presentationDefault[$table->getAdminPresentation()] = ' selected'; $tableName = $table->getTableName(); $orderingColumnForListings = $table->getOrderingColumnForListings(); $appearsInAdminMenu = $table->getAppearsInAdminMenu(); if ($appearsInAdminMenu == '1') { $appearsInAdminMenu = ' checked'; } else { $appearsInAdminMenu = ''; } $adminItemsPerPage = $table->getAdminItemsPerPage(); $adminListMarkingCondition = $table->getAdminListMarkingCondition(); $adminListMarkedStyle = $table->getAdminListMarkedStyle(); $groupedByTable = $table->getGroupedByTable(); $remoteGroupColumn = $table->getRemoteGroupColumn(); $localGroupColumn = $table->getLocalGroupColumn(); $tablesGroupedByThis = $table->getTablesGroupedByThis(); $hasActivationFlag = $table->getHasActivationFlag(); $columnForMultipleTemplates = $table->getColumnForMultipleTemplates();