echo '</thead>'; echo '<tbody>'; $curclass = "row1"; $tags = UserTagOperations::get_instance()->ListUserTags(); if (count($tags)) { foreach ($tags as $oneplugin => $label) { $tag = UserTagOperations::get_instance()->GetUserTag($oneplugin); echo "<tr class=\"" . $curclass . "\">\n"; echo "<td><a href=\"edituserplugin.php" . $urlext . "&userplugin_id=" . $oneplugin . "\">{$label}</a></td>\n"; echo "<td>" . listudt_summarize($tag['description'], 20) . "</td>\n"; echo "<td class=\"icons_wide\"><a href=\"runuserplugin.php" . $urlext . "&userplugin_id=" . $oneplugin . "\">"; echo $themeObject->DisplayImage('icons/system/run.gif', lang('run_udt'), '', '', 'systemicon') . "</a></td>\n"; echo "<td class=\"icons_wide\"><a href=\"edituserplugin.php" . $urlext . "&userplugin_id=" . $oneplugin . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; echo "<td class=\"icons_wide\"><a href=\"deleteuserplugin.php" . $urlext . "&userplugin_id=" . $oneplugin . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $oneplugin), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; echo "</tr>\n"; $curclass == "row1" ? $curclass = "row2" : ($curclass = "row1"); } } ?> </tbody> </table> <div class="pageoptions"> <p class="pageoptions"> <a href="adduserplugin.php<?php echo $urlext; ?> ">
echo "<td>{$oneuser->username}</td>\n"; } if ($oneuser->id != 1 && $oneuser->id != $userid) { echo "<td class=\"pagepos\"><a href=\"listusers.php" . $urlext . "&toggleactive=" . $oneuser->id . "\">" . ($oneuser->active == 1 ? $image_true : $image_false) . "</a></td>\n"; } else { echo "<td class=\"pagepos\"> </td>\n"; } if ($access_user) { echo "<td><a href=\"edituser.php" . $urlext . "&user_id=" . $oneuser->id . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>\n"; } if ($remove && $oneuser->id != 1 && $oneuser->id != $userid) { echo "<td><a href=\"deleteuser.php" . $urlext . "&user_id=" . $oneuser->id . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $oneuser->username), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>\n"; } echo "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $counter++; } echo '</tbody>'; echo "</table>\n"; } if (check_permission($userid, 'Add Users')) { ?>
$actioncol[] = "<a href=\"{$thisurl}&action=uninstall&module=" . $key . "\" onclick=\"return confirm('" . ($modinstance->UninstallPreMessage() !== FALSE ? cms_utf8entities($modinstance->UninstallPreMessage()) : lang('uninstallconfirm') . ' ' . $key) . "');\">" . lang('uninstall') . "</a>"; } else { // HAS DEPENDENTS =============== $result = $db->Execute("SELECT child_module from\n\t\t\t\t\t" . cms_db_prefix() . "module_deps WHERE parent_module='{$key}'"); $dependentof = array(); while ($result && ($row = $result->FetchRow())) { $dependentof[$row['child_module']] = ""; } $str = implode(array_keys($dependentof), ", "); $activecol = $dbm[$key]['Active'] == true ? $image_true : "<a href='{$thisurl}&action=settrue&module=" . $key . "'>" . $image_false . "</a>"; $statuscol[] = lang('hasdependents') . " (<strong>{$str}</strong>)"; // END HAS DEPENDENTS =========== } if (!$permsok) { $statuscol[] = lang('cantremove'); $actioncol[] = "<a href=\"{$thisurl}&action=chmod&module=" . $key . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('changepermissionsconfirm'), true) . "');\">" . lang('changepermissions') . "</a>"; } } } //Is there help? if ($modinstance->GetHelp() != '') { $helpcol = "<a href=\"{$thisurl}&action=showmodulehelp&module=" . $key . "\">" . lang('help') . "</a>"; } //About is constructed from other details now $aboutcol = "<a href=\"{$thisurl}&action=showmoduleabout&module=" . $key . "\">" . lang('about') . "</a>"; // row output echo "<tr class=\"" . $curclass . "\" onmouseover=\"this.className='" . $curclass . 'hover' . "';\" onmouseout=\"this.className='" . $curclass . "';\">\n"; echo "<td>{$namecol}</td>"; echo "<td>{$versioncol}</td>"; if ($statusspans === true) { echo '<td colspan="3">' . implode('<br/>', $statuscol) . "</td>";
function display_hierarchy(&$root, &$userid, $modifyall, &$users, &$menupos, &$openedArray, &$pagelist, &$image_true, &$image_set_false, &$image_set_true, &$upImg, &$downImg, &$viewImg, &$editImg, &$copyImg, &$deleteImg, &$expandImg, &$contractImg, &$mypages, &$page, $columnstodisplay, $author_allpages) { global $thisurl; global $urlext; global $currow; global $config; global $page; global $indent; if (empty($currow)) { $currow = 'row1'; } $children = $root->getChildren(false, true); $one = $root->getContent(); $thelist = ''; if (!(isset($one) && $one != NULL)) { audit($root->get_tag('id'), 'Core', 'failed to get content for valid content id ' . $root->get_tag('id')); return; } if (!array_key_exists($one->Owner(), $users)) { $userops = cmsms()->GetUserOperations(); $users[$one->Owner()] = $userops->LoadUserById($one->Owner()); } $display = 'none'; if (check_modify_all($userid) || check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) { $display = 'edit'; } else { if (check_children($root, $mypages, $userid)) { $display = 'view'; } else { if (check_permission($userid, 'Manage All Content')) { $display = 'structure'; } } } $columns = array(); if ($display != 'none') { $thelist .= "<tr id=\"tr_" . $one->Id() . "\" class=\"{$currow}\">\n"; /* expand/collapse column */ $columns['expand'] = ' '; if ($columnstodisplay['expand']) { $txt = ''; if ($root->hasChildren()) { if (!in_array($one->Id(), $openedArray)) { $txt .= "<a class=\"expand\" href=\"{$thisurl}&content_id=" . $one->Id() . "&col=0&page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'false'); return false;\">"; $txt .= $expandImg; $txt .= "</a>"; } else { $txt .= "<a class=\"contract\" href=\"{$thisurl}&content_id=" . $one->Id() . "&col=1&page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'true'); return false;\">"; $txt .= $contractImg; $txt .= "</a>"; } } if (!empty($txt)) { $columns['expand'] = $txt; } } /* hierarchy column */ if ($columnstodisplay['hier']) { $columns['hier'] = $one->Hierarchy(); } /* page column */ if ($columnstodisplay['page']) { $columns['page'] = ' '; $txt = ''; if ($one->MenuText() != CMS_CONTENT_HIDDEN_NAME) { if ($indent) { for ($i = 0; $i < $root->getLevel(); $i++) { $txt .= "- "; } } $str = $one->MenuText(); if (get_site_preference('listcontent_showtitle', 0)) { $str = $one->Name(); } if ($display == 'edit') { $txt .= '<a class="tooltip" href="editcontent.php' . $urlext . '&content_id=' . $one->Id() . '&page=' . $page . '" title="' . cms_htmlentities($one->Name() . ' (' . $one->Alias() . ')', '', '', true) . '" onmouseover="document.getElementById(\'' . $one->Id() . '_info\').style.display = \'inline-block\';" onmouseout="document.getElementById(\'' . $one->Id() . '_info\').style.display = \'none\';"> ' . cms_htmlentities($str, '', '', true) . '<span id="' . $one->Id() . '_info"><strong>' . lang('content_id') . ':</strong> ' . $one->Id() . '<br /> <strong>' . lang('title') . ':</strong> ' . cms_htmlentities($one->Name()) . '<br /> <strong>' . lang('pagealias') . ':</strong> ' . $one->Alias() . '</span></a>'; } else { $txt .= cms_htmlentities($str, '', '', true); } } if (!empty($txt)) { $columns['page'] = $txt; } } /* alias column */ if ($columnstodisplay['alias']) { $columns['alias'] = ' '; $txt = ''; if ($one->HasUsableLink() && $one->Alias() != '') { $txt = $one->Alias(); } if (!empty($txt)) { $columns['alias'] = $txt; } } /* url column */ if ($columnstodisplay['url']) { $columns['url'] = ' '; $txt = ''; if ($one->HasUsableLink() && $one->URL() != '') { $url = $one->URL(); if (strlen($url) > 30) { $url = '...' . substr($url, strlen($url) - 27); } $txt = $url; } if (!empty($txt)) { if (!prettyurls_ok()) { $txt = '<span style="color: red;" title="' . lang('prettyurls_noeffect') . '">' . $txt . '<span>'; } } if (!empty($txt)) { $columns['url'] = $txt; } } /* template column */ if ($columnstodisplay['template']) { $columns['template'] = ' '; $txt = ''; if ($one->Type() != 'pagelink' && $one->Type() != 'link' && $one->Type() != 'sectionheader' && $one->Type() != 'separator') { $template = TemplateOperations::get_instance()->LoadTemplateById($one->TemplateId()); if ($template && check_permission($userid, 'Modify Template')) { $txt .= "<a title=\"" . lang('edittemplate') . "\" href=\"edittemplate.php" . $urlext . "&template_id=" . $one->TemplateId() . "&from=content\">" . cms_htmlentities($template->name, '', '', true) . "</a>"; } else { if ($template) { $txt .= $template->name; } } } if (!empty($txt)) { $columns['template'] = $txt; } } /* friendly name column */ if ($columnstodisplay['friendlyname']) { $columns['friendlyname'] = $one->FriendlyName(); } /* owner column */ if ($columnstodisplay['owner']) { $columns['owner'] = ' '; if ($one->Owner() > -1) { $columns['owner'] = $users[$one->Owner()]->username; } } /* active column */ if ($columnstodisplay['active']) { $columns['active'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content') && $one->Type() != 'errorpage') { if ($one->Active()) { $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&setinactive=" . $one->Id() . "\" onclick=\"xajax_content_setinactive(" . $one->Id() . ");return false;\">" . $image_set_false . "</a>"; } else { $txt = "<a href=\"{$thisurl}&setactive=" . $one->Id() . "\" onclick=\"xajax_content_setactive(" . $one->Id() . ");return false;\">" . $image_set_true . "</a>"; } } if (!empty($txt)) { $columns['active'] = $txt; } } /* default content */ if ($columnstodisplay['default']) { $columns['default'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content')) { if ($one->IsDefaultPossible()) { $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&makedefault=" . $one->Id() . "\" onclick=\"if(confirm('" . cms_html_entity_decode_utf8(lang("confirmdefault", $one->Name()), true) . "')) xajax_content_setdefault(" . $one->Id() . ");return false;\">" . $image_set_true . "</a>"; } } if (!empty($txt)) { $columns['default'] = $txt; } } /* move column */ if ($columnstodisplay['move']) { // code for move up is simple $columns['move'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content') || $author_allpages) { $sameLevel = $root->getSiblingCount(); if ($sameLevel > 1) { if ($one->ItemOrder() - 1 <= 0) { $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&direction=down&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $downImg; $txt .= "</a> "; } else { if ($one->ItemOrder() - 1 == $sameLevel - 1) { $txt .= " <a class=\"move_up\" onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&direction=up&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $upImg; $txt .= "</a>"; } else { $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&direction=down&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $downImg; $txt .= "</a> <a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&direction=up&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $upImg; $txt .= "</a>"; } } } // $txt .= '<input clsss="hidden" type="text" name="order-'. $one->Id().'" value="'.$one->ItemOrder().'" class="order" />'; } if (!empty($txt)) { $columns['move'] = $txt; } // end of move code } /* view column */ if ($columnstodisplay['view']) { $columns['view'] = ' '; $txt = ''; $url = $one->GetURL(); if ($url != '' && $url != '#' && $one->IsViewable() && $one->Active()) { $txt .= "<a href=\"" . $url . "\" rel=\"external\" target=\"_blank\">"; $txt .= $viewImg . "</a>"; } if (!empty($txt)) { $columns['view'] = $txt; } } /* copy column */ if ($columnstodisplay['copy']) { $columns['copy'] = ' '; $txt = ''; if ($one->IsCopyable() && (check_permission($userid, 'Add Pages') && (check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) || check_permission($userid, 'Manage All Content'))) { $txt .= '<a href="copycontent.php' . $urlext . '&content_id=' . $one->Id() . '">'; $txt .= $copyImg . "</a>"; } if (!empty($txt)) { $columns['copy'] = $txt; } } /* edit column */ if ($columnstodisplay['edit']) { $columns['edit'] = ' '; $txt = ''; if (check_modify_all($userid) || check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages) || check_permission($userid, 'Manage All Content')) { // edit link $txt .= "<a href=\"editcontent.php" . $urlext . "&content_id=" . $one->Id() . "\">"; $txt .= $editImg; $txt .= "</a>"; } if (!empty($txt)) { $columns['edit'] = $txt; } } /* delete column */ if ($columnstodisplay['delete']) { $columns['delete'] = ' '; $txt = ''; if ($one->DefaultContent() != true) { if ($root->getChildrenCount() == 0 && (check_permission($userid, 'Remove Pages') && (check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) || check_permission($userid, 'Manage All Content'))) { //$txt .= "<a href=\"{$thisurl}&deletecontent=".$one->Id()."\" onclick=\"confirm('".cms_html_entity_decode_utf8(lang('deleteconfirm', $one->mName), true)."');\">"; $txt .= "<a href=\"{$thisurl}&deletecontent=" . $one->Id() . "\" onclick=\"if (confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $one->Name()), true) . "')) xajax_content_delete(" . $one->Id() . "); return false;\">"; $txt .= $deleteImg; $txt .= "</a>"; } } if (!empty($txt)) { $columns['delete'] = $txt; } } if ($columnstodisplay['multiselect']) { /* multiselect */ $columns['multiselect'] = ' '; $txt = ''; $remove = check_permission($userid, 'Remove Pages') ? 1 : 0; $structure = check_permission($userid, 'Manage All Content') ? 1 : 0; $editperms = check_permission($userid, 'Modify Any Page') || quick_check_authorship($one->Id(), $mypages) || check_ownership($userid, $one->Id()) ? 1 : 0; if (($structure == 1 || $remove == 1 && $editperms == 1) && $one->Type() != 'errorpage') { $txt .= '<label class="invisible" for="multicontent-' . $one->Id() . '">' . lang('toggle') . '</label><input type="checkbox" id="multicontent-' . $one->Id() . '" name="multicontent-' . $one->Id() . '" title="' . lang('toggle') . '"/>'; } if (!empty($txt)) { $columns['multiselect'] = $txt; } } /* done */ foreach ($columns as $name => $value) { if (!$columnstodisplay[$name]) { continue; } switch ($name) { case 'edit': case 'default': case 'view': case 'copy': case 'delete': case 'active': $thelist .= '<td class="pagepos">' . $value . "</td>\n"; break; case 'move': $thelist .= '<td class="move">' . $value . "</td>\n"; break; case 'multiselect': $thelist .= '<td class="checkbox">' . $value . "</td>\n"; break; default: $thelist .= '<td>' . $value . "</td>\n"; break; } } $thelist .= "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $pagelist[] = $thelist; $indent = get_preference($userid, 'indent', true); if (in_array($one->Id(), $openedArray) && is_array($children) && count($children)) { // count through all the children and see if we can display the move column. $author_allpages = check_permission($userid, 'Reorder Content') && check_peer_authorship($userid, $children[0]->getId()); foreach ($children as $child) { display_hierarchy($child, $userid, $modifyall, $users, $menupos, $openedArray, $pagelist, $image_true, $image_set_false, $image_set_true, $upImg, $downImg, $viewImg, $editImg, $copyImg, $deleteImg, $expandImg, $contractImg, $mypages, $page, $columnstodisplay, $author_allpages); } } }
echo $themeObject->DisplayImage('icons/system/copy.gif', lang('copy'), '', '', 'systemicon'); echo "</a></td>\n"; } # edit template if ($edit) { echo "<td class=\"icons_wide\"><a href=\"edittemplate.php" . $urlext . "&template_id=" . $onetemplate->id . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; } # remove template if ($remove) { echo "<td class=\"icons_wide\">"; if ($onetemplate->default) { echo ' '; } else { echo "<a href=\"deletetemplate.php" . $urlext . "&template_id=" . $onetemplate->id . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $onetemplate->name), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a>"; } echo "</td>\n"; } if ($onetemplate->default) { echo '<td> </td>'; } else { echo '<td><input type="checkbox" name="multitemplate-' . $onetemplate->id . '" /></td>'; } echo "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $counter++; }
function display_hierarchy(&$root, &$userid, $modifyall, &$templates, &$users, &$menupos, &$openedArray, &$pagelist, &$image_true, &$image_set_false, &$image_set_true, &$upImg, &$downImg, &$viewImg, &$editImg, &$copyImg, &$deleteImg, &$expandImg, &$contractImg, &$mypages, &$page, $columnstodisplay) { global $thisurl; global $urlext; global $currow; global $config; global $page; global $indent; if (empty($currow)) { $currow = 'row1'; } $children =& $root->getChildren(false, true); $one =& $root->getContent(); $thelist = ''; if (!(isset($one) && $one != NULL)) { return; } if (!array_key_exists($one->TemplateId(), $templates)) { global $gCms; $templateops =& $gCms->GetTemplateOperations(); $templates[$one->TemplateId()] = $templateops->LoadTemplateById($one->TemplateId()); } if (!array_key_exists($one->Owner(), $users)) { global $gCms; $userops =& $gCms->GetUserOperations(); $users[$one->Owner()] =& $userops->LoadUserById($one->Owner()); } $display = 'none'; if (check_modify_all($userid) || check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) { $display = 'edit'; } else { if (check_children($root, $mypages, $userid)) { $display = 'view'; } else { if (check_permission($userid, 'Manage All Content')) { $display = 'structure'; } } } $columns = array(); if ($display != 'none') { $thelist .= "<tr id=\"tr_" . $one->Id() . "\" class=\"{$currow}\" onmouseover=\"this.className='" . $currow . 'hover' . "';\" onmouseout=\"this.className='" . $currow . "';\">\n"; /* expand/collapse column */ $columns['expand'] = ' '; if ($columnstodisplay['expand']) { $txt = ''; if ($root->hasChildren()) { if (!in_array($one->Id(), $openedArray)) { $txt .= "<a href=\"{$thisurl}&content_id=" . $one->Id() . "&col=0&page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'false'); return false;\">"; $txt .= $expandImg; $txt .= "</a>"; } else { $txt .= "<a href=\"{$thisurl}&content_id=" . $one->Id() . "&col=1&page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'true'); return false;\">"; $txt .= $contractImg; $txt .= "</a>"; } } if (!empty($txt)) { $columns['expand'] = $txt; } } /* hierarchy column */ if ($columnstodisplay['hier']) { $columns['hier'] = $one->Hierarchy(); } /* page column */ if ($columnstodisplay['page']) { $columns['page'] = ' '; $txt = ''; if ($one->mMenuText != CMS_CONTENT_HIDDEN_NAME) { if ($indent) { for ($i = 0; $i < $root->getLevel(); $i++) { $txt .= "- "; } } if ($display == 'edit') { $txt .= '<a href="editcontent.php' . $urlext . '&content_id=' . $one->mId . '&page=' . $page . '" title="' . cms_htmlentities($one->mName . ' (' . $one->mAlias . ')', '', '', true) . '">' . cms_htmlentities($one->mMenuText, '', '', true) . '</a>'; } else { $txt .= cms_htmlentities($one->mMenuText, '', '', true); } } if (!empty($txt)) { $columns['page'] = $txt; } } /* template column */ if ($columnstodisplay['template']) { $columns['template'] = ' '; $txt = ''; if ($one->Type() != 'pagelink' && $one->Type() != 'link' && $one->Type() != 'sectionheader' && $one->Type() != 'separator') { if (isset($templates[$one->TemplateId()]->name) && $templates[$one->TemplateId()]->name && check_permission($userid, 'Modify Templates')) { $txt .= "<a href=\"edittemplate.php" . $urlext . "&template_id=" . $one->TemplateId() . "&from=content\">" . cms_htmlentities($templates[$one->TemplateId()]->name, '', '', true) . "</a>"; } else { $txt .= $templates[$one->TemplateId()]->name; } } if (!empty($txt)) { $columns['template'] = $txt; } } /* friendly name column */ if ($columnstodisplay['friendlyname']) { $columns['friendlyname'] = $one->FriendlyName(); } /* owner column */ if ($columnstodisplay['owner']) { $columns['owner'] = ' '; if ($one->Owner() > -1) { $columns['owner'] = $users[$one->Owner()]->username; } } /* active column */ if ($columnstodisplay['active']) { $columns['active'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content') && $one->Type() != 'errorpage') { if ($one->Active()) { $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&setinactive=" . $one->Id() . "\" onclick=\"xajax_content_setinactive(" . $one->Id() . ");return false;\">" . $image_set_false . "</a>"; } else { $txt = "<a href=\"{$thisurl}&setactive=" . $one->Id() . "\" onclick=\"xajax_content_setactive(" . $one->Id() . ");return false;\">" . $image_set_true . "</a>"; } } if (!empty($txt)) { $columns['active'] = $txt; } } /* default content */ if ($columnstodisplay['default']) { $columns['default'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content')) { if ($one->IsDefaultPossible()) { $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&makedefault=" . $one->Id() . "\" onclick=\"if(confirm('" . cms_html_entity_decode_utf8(lang("confirmdefault", $one->mName), true) . "')) xajax_content_setdefault(" . $one->Id() . ");return false;\">" . $image_set_true . "</a>"; } } if (!empty($txt)) { $columns['default'] = $txt; } } /* move column */ if ($columnstodisplay['move']) { // code for move up is simple $columns['move'] = ' '; $txt = ''; if (check_permission($userid, 'Manage All Content')) { $sameLevel = $root->getSiblingCount(); if ($sameLevel > 1) { if ($one->ItemOrder() - 1 <= 0) { $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&direction=down&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $downImg; $txt .= "</a> "; } else { if ($one->ItemOrder() - 1 == $sameLevel - 1) { $txt .= " <a class=\"move_up\" onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&direction=up&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $upImg; $txt .= "</a>"; } else { $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&direction=down&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $downImg; $txt .= "</a> <a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&direction=up&content_id=" . $one->Id() . "&parent_id=" . $one->ParentId() . "&page=" . $page . "\">"; $txt .= $upImg; $txt .= "</a>"; } } } // $txt .= '<input clsss="hidden" type="text" name="order-'. $one->Id().'" value="'.$one->ItemOrder().'" class="order" />'; } if (!empty($txt)) { $columns['move'] = $txt; } // end of move code } /* view column */ if ($columnstodisplay['view']) { $columns['view'] = ' '; $txt = ''; $url = $one->GetURL(); if ($url != '' && $url != '#' && $one->IsViewable() && $one->Active()) { $txt .= "<a href=\"" . $url . "\" rel=\"external\" target=\"_blank\">"; $txt .= $viewImg . "</a>"; } if (!empty($txt)) { $columns['view'] = $txt; } } /* copy column */ if ($columnstodisplay['copy']) { $columns['copy'] = ' '; $txt = ''; if ($one->IsCopyable() && (check_permission($userid, 'Add Pages') && (check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) || check_permission($userid, 'Manage All Content'))) { $txt .= '<a href="copycontent.php' . $urlext . '&content_id=' . $one->Id() . '">'; $txt .= $copyImg . "</a>"; } if (!empty($txt)) { $columns['copy'] = $txt; } } /* edit column */ if ($columnstodisplay['edit']) { $columns['edit'] = ' '; $txt = ''; if (check_modify_all($userid) || check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages) || check_permission($userid, 'Manage All Content')) { // edit link $txt .= "<a href=\"editcontent.php" . $urlext . "&content_id=" . $one->Id() . "\">"; $txt .= $editImg; $txt .= "</a>"; } if (!empty($txt)) { $columns['edit'] = $txt; } } /* delete column */ if ($columnstodisplay['delete']) { $columns['delete'] = ' '; $txt = ''; if ($one->DefaultContent() != true) { if ($root->getChildrenCount() == 0 && (check_permission($userid, 'Remove Pages') && (check_ownership($userid, $one->Id()) || quick_check_authorship($one->Id(), $mypages)) || check_permission($userid, 'Manage All Content'))) { $txt .= "<a href=\"{$thisurl}&deletecontent=" . $one->Id() . "\" onclick=\"if (confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $one->mName), true) . "')) xajax_content_delete(" . $one->Id() . "); return false;\">"; $txt .= $deleteImg; $txt .= "</a>"; } } if (!empty($txt)) { $columns['delete'] = $txt; } } if ($columnstodisplay['multiselect']) { /* multiselect */ $columns['multiselect'] = ' '; $txt = ''; $remove = check_permission($userid, 'Remove Pages') ? 1 : 0; $structure = check_permission($userid, 'Manage All Content') ? 1 : 0; $editperms = check_permission($userid, 'Modify Any Page') || quick_check_authorship($one->Id(), $mypages) || check_ownership($userid, $one->Id()) ? 1 : 0; if (($structure == 1 || $remove == 1 && $editperms == 1) && $one->Type() != 'errorpage') { $txt .= '<input type="checkbox" name="multicontent-' . $one->Id() . '" />'; } if (!empty($txt)) { $columns['multiselect'] = $txt; } } /* done */ foreach ($columns as $name => $value) { if (!$columnstodisplay[$name]) { continue; } switch ($name) { case 'edit': case 'default': case 'view': case 'copy': case 'delete': case 'active': $thelist .= '<td class="pagepos">' . $value . "</td>\n"; break; case 'move': $thelist .= '<td class="move">' . $value . "</td>\n"; break; case 'multiselect': $thelist .= '<td class="checkbox">' . $value . "</td>\n"; break; default: $thelist .= '<td>' . $value . "</td>\n"; break; } } $thelist .= "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $pagelist[] =& $thelist; $indent = get_preference($userid, 'indent', true); if (in_array($one->Id(), $openedArray)) { foreach ($children as $child) { display_hierarchy($child, $userid, $modifyall, $templates, $users, $menupos, $openedArray, $pagelist, $image_true, $image_set_false, $image_set_true, $upImg, $downImg, $viewImg, $editImg, $copyImg, $deleteImg, $expandImg, $contractImg, $mypages, $page, $columnstodisplay); } } }
echo '<tbody>'; # this var is used to show each line with different color $currow = "row1"; # now showing each line while ($one = $result->FetchRow()) { # we store ids of templates found for them not to appear in the dropdown $csslist[] = $one["assoc_to_id"]; echo "<tr class=\"{$currow}\">\n"; if ($modifytpl) { echo "<td><a href=\"edittemplate.php" . $urlext . "&template_id=" . $one["assoc_to_id"] . "&from=cssassoc&cssid=" . $id . "\">" . $one["template_name"] . "</a></td>\n"; } else { echo "<td>" . $one['template_name'] . "</td>\n"; } # if user has right to delete if ($modify || $delasso) { echo "<td><a href=\"deletetemplateassoc.php" . $urlext . "&id=" . $id . "&template_id=" . $one["assoc_to_id"] . "&type={$type}\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteassociationconfirm', $one['template_name']), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>"; } echo "</tr>\n"; "row1" == $currow ? $currow = "row2" : ($currow = "row1"); } ## foreach echo '</tbody>'; echo "</table>\n"; } # end of if result if ($modify || $addasso) { # this var is used to store the css ids that should not appear in the
echo $themeObject->DisplayImage('icons/system/copy.gif', lang('copy'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>"; } // if user has right to edit if ($modify) { echo "<td class=\"icons_wide\"><a href=\"editcss.php" . $urlext . "&css_id=" . $one["css_id"] . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>"; } // if user has right to delete if ($delcss) { echo "<td class=\"icons_wide\"><a href=\"deletecss.php" . $urlext . "&css_id=" . $one["css_id"] . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $one['css_name']), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo "<td> </td>"; } if ($delcss) { echo '<td><input type="checkbox" name="multistylesheet-' . $one['css_id'] . '" /></td>'; } else { echo '<td></td>'; } echo "</tr>\n"; "row1" == $currow ? $currow = "row2" : ($currow = "row1"); } $counter++; }
echo '</thead>'; echo '<tbody>'; $currow = "row1"; // construct true/false button images $image_true = $themeObject->DisplayImage('icons/system/true.gif', lang('true'), '', '', 'systemicon'); $image_false = $themeObject->DisplayImage('icons/system/false.gif', lang('false'), '', '', 'systemicon'); $counter = 0; foreach ($marklist as $onemark) { if ($counter < $page * $limit && $counter >= $page * $limit - $limit) { echo "<tr class=\"{$currow}\" onmouseover=\"this.className='" . $currow . 'hover' . "';\" onmouseout=\"this.className='" . $currow . "';\">\n"; echo "<td><a href=\"editbookmark.php" . $urlext . "&bookmark_id=" . $onemark->bookmark_id . "\">" . $onemark->title . "</a></td>\n"; echo "<td>" . $onemark->url . "</td>\n"; echo "<td><a href=\"editbookmark.php" . $urlext . "&bookmark_id=" . $onemark->bookmark_id . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; echo "<td><a href=\"deletebookmark.php" . $urlext . "&bookmark_id=" . $onemark->bookmark_id . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $onemark->title), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; echo "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $counter++; } echo '</tbody>'; echo "</table>\n"; } ?> <div class="pageoptions"> <p class="pageoptions"> <a href="addbookmark.php<? echo $urlext ?>"> <?php
} } echo "</td>\n"; if ($perm) { echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupperm.php" . $urlext . "&group_id=" . $onegroup->id . "\">" . $image_permissions . "</a></td>\n"; } if ($assign) { echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupassign.php" . $urlext . "&group_id=" . $onegroup->id . "\">" . $image_groupassign . "</a></td>\n"; } if ($edit) { echo "<td class=\"icons_wide\"><a href=\"editgroup.php" . $urlext . "&group_id=" . $onegroup->id . "\">"; echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon'); echo "</a></td>\n"; } if ($remove && $onegroup->id != 1 && !$userops->UserInGroup($userid, $onegroup->id)) { echo "<td class=\"icons_wide\"><a href=\"deletegroup.php" . $urlext . "&group_id=" . $onegroup->id . "\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteconfirm', $onegroup->name), true) . "');\">"; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon'); echo "</a></td>\n"; } else { echo '<td class="icons_wide"> </td>' . "\n"; } echo "</tr>\n"; $currow == "row1" ? $currow = "row2" : ($currow = "row1"); } $counter++; } echo '</tbody>'; echo "</table>\n"; } if (check_permission($userid, 'Add Groups')) { ?>
$url = "editcss.php" . $urlext . "&css_id=" . $row['assoc_css_id'] . "&from=templatecssassoc&templateid=" . $id; $tmp['editlink'] = '<a href="' . $url . '">' . $row['css_name'] . '</a>'; $tmp['editimg'] = '<a href="' . $url . '">' . $themeObject->DisplayImage('icons/system/edit.gif', lang('editcss'), '', '', 'systemicon') . '</a>'; if ($modify) { $downurl = 'listcssassoc.php' . $urlext . '&dir=down&cssid=' . $row['assoc_css_id'] . '&id=' . $id . '&type=template'; $upurl = 'listcssassoc.php' . $urlext . '&dir=up&cssid=' . $row['assoc_css_id'] . '&id=' . $id . '&type=template'; if ($idx > 0) { $tmp['uplink'] = '<a href="' . $upurl . '">' . $themeObject->DisplayImage('icons/system/arrow-u.gif', lang('up'), '', '', 'systemicon') . '</a>'; } if ($idx + 1 < $count) { $tmp['downlink'] = '<a href="' . $downurl . '">' . $themeObject->DisplayImage('icons/system/arrow-d.gif', lang('down'), '', '', 'systemicon') . '</a>'; } $idx++; } if ($delasso) { $tmp['deletelink'] = "<a href=\"deletecssassoc.php" . $urlext . "&id={$id}&css_id=" . $row["assoc_css_id"] . "&type={$type}\" onclick=\"return confirm('" . cms_html_entity_decode_utf8(lang('deleteassociationconfirm', $row["css_name"]), true) . "');\">" . $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'), '', '', 'systemicon') . "</a>"; } $cssassoc[] = $tmp; } } else { redirect('listtemplates.php' . $urlext . '&message=' . lang('sqlerror', 'listcssassoc.php')); } if (count($cssassoc)) { $smarty->assign('cssassoc', $cssassoc); } # this var is used to store the css ids that should not appear in the # dropdown $notinto = ""; foreach ($csslist as $key) { $notinto .= "{$key},"; }