Example #1
0
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 . "&amp;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 . "&amp;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 . "&amp;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 . "&amp;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;
?>
">
Example #2
0
                echo "<td>{$oneuser->username}</td>\n";
            }
            if ($oneuser->id != 1 && $oneuser->id != $userid) {
                echo "<td class=\"pagepos\"><a href=\"listusers.php" . $urlext . "&amp;toggleactive=" . $oneuser->id . "\">" . ($oneuser->active == 1 ? $image_true : $image_false) . "</a></td>\n";
            } else {
                echo "<td class=\"pagepos\">&nbsp;</td>\n";
            }
            if ($access_user) {
                echo "<td><a href=\"edituser.php" . $urlext . "&amp;user_id=" . $oneuser->id . "\">";
                echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon');
                echo "</a></td>\n";
            } else {
                echo "<td>&nbsp;</td>\n";
            }
            if ($remove && $oneuser->id != 1 && $oneuser->id != $userid) {
                echo "<td><a href=\"deleteuser.php" . $urlext . "&amp;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>&nbsp;</td>\n";
            }
            echo "</tr>\n";
            $currow == "row1" ? $currow = "row2" : ($currow = "row1");
        }
        $counter++;
    }
    echo '</tbody>';
    echo "</table>\n";
}
if (check_permission($userid, 'Add Users')) {
    ?>
Example #3
0
             $actioncol[] = "<a href=\"{$thisurl}&amp;action=uninstall&amp;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}&amp;action=settrue&amp;module=" . $key . "'>" . $image_false . "</a>";
             $statuscol[] = lang('hasdependents') . " (<strong>{$str}</strong>)";
             // END HAS DEPENDENTS ===========
         }
         if (!$permsok) {
             $statuscol[] = lang('cantremove');
             $actioncol[] = "<a href=\"{$thisurl}&amp;action=chmod&amp;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}&amp;action=showmodulehelp&amp;module=" . $key . "\">" . lang('help') . "</a>";
 }
 //About is constructed from other details now
 $aboutcol = "<a href=\"{$thisurl}&amp;action=showmoduleabout&amp;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>";
Example #4
0
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'] = '&nbsp;';
        if ($columnstodisplay['expand']) {
            $txt = '';
            if ($root->hasChildren()) {
                if (!in_array($one->Id(), $openedArray)) {
                    $txt .= "<a class=\"expand\" href=\"{$thisurl}&amp;content_id=" . $one->Id() . "&amp;col=0&amp;page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'false'); return false;\">";
                    $txt .= $expandImg;
                    $txt .= "</a>";
                } else {
                    $txt .= "<a class=\"contract\" href=\"{$thisurl}&amp;content_id=" . $one->Id() . "&amp;col=1&amp;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'] = '&nbsp;';
            $txt = '';
            if ($one->MenuText() != CMS_CONTENT_HIDDEN_NAME) {
                if ($indent) {
                    for ($i = 0; $i < $root->getLevel(); $i++) {
                        $txt .= "-&nbsp;&nbsp;&nbsp;";
                    }
                }
                $str = $one->MenuText();
                if (get_site_preference('listcontent_showtitle', 0)) {
                    $str = $one->Name();
                }
                if ($display == 'edit') {
                    $txt .= '<a class="tooltip" href="editcontent.php' . $urlext . '&amp;content_id=' . $one->Id() . '&amp;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'] = '&nbsp;';
            $txt = '';
            if ($one->HasUsableLink() && $one->Alias() != '') {
                $txt = $one->Alias();
            }
            if (!empty($txt)) {
                $columns['alias'] = $txt;
            }
        }
        /* url column */
        if ($columnstodisplay['url']) {
            $columns['url'] = '&nbsp;';
            $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'] = '&nbsp;';
            $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 . "&amp;template_id=" . $one->TemplateId() . "&amp;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'] = '&nbsp;';
            if ($one->Owner() > -1) {
                $columns['owner'] = $users[$one->Owner()]->username;
            }
        }
        /* active column */
        if ($columnstodisplay['active']) {
            $columns['active'] = '&nbsp;';
            $txt = '';
            if (check_permission($userid, 'Manage All Content') && $one->Type() != 'errorpage') {
                if ($one->Active()) {
                    $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&amp;setinactive=" . $one->Id() . "\" onclick=\"xajax_content_setinactive(" . $one->Id() . ");return false;\">" . $image_set_false . "</a>";
                } else {
                    $txt = "<a href=\"{$thisurl}&amp;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'] = '&nbsp;';
            $txt = '';
            if (check_permission($userid, 'Manage All Content')) {
                if ($one->IsDefaultPossible()) {
                    $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&amp;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'] = '&nbsp;';
            $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}&amp;direction=down&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                        $txt .= $downImg;
                        $txt .= "</a>&nbsp;&nbsp;";
                    } else {
                        if ($one->ItemOrder() - 1 == $sameLevel - 1) {
                            $txt .= "&nbsp;&nbsp;<a class=\"move_up\" onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&amp;direction=up&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                            $txt .= $upImg;
                            $txt .= "</a>";
                        } else {
                            $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&amp;direction=down&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                            $txt .= $downImg;
                            $txt .= "</a>&nbsp;<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&amp;direction=up&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;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'] = '&nbsp;';
            $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'] = '&nbsp;';
            $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 . '&amp;content_id=' . $one->Id() . '">';
                $txt .= $copyImg . "</a>";
            }
            if (!empty($txt)) {
                $columns['copy'] = $txt;
            }
        }
        /* edit column */
        if ($columnstodisplay['edit']) {
            $columns['edit'] = '&nbsp;';
            $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 . "&amp;content_id=" . $one->Id() . "\">";
                $txt .= $editImg;
                $txt .= "</a>";
            }
            if (!empty($txt)) {
                $columns['edit'] = $txt;
            }
        }
        /* delete column */
        if ($columnstodisplay['delete']) {
            $columns['delete'] = '&nbsp;';
            $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}&amp;deletecontent=".$one->Id()."\" onclick=\"confirm('".cms_html_entity_decode_utf8(lang('deleteconfirm', $one->mName), true)."');\">";
                    $txt .= "<a href=\"{$thisurl}&amp;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'] = '&nbsp;';
            $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);
        }
    }
}
Example #5
0
             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 . "&amp;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 '&nbsp;';
             } else {
                 echo "<a href=\"deletetemplate.php" . $urlext . "&amp;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>&nbsp;</td>';
         } else {
             echo '<td><input type="checkbox" name="multitemplate-' . $onetemplate->id . '" /></td>';
         }
         echo "</tr>\n";
         $currow == "row1" ? $currow = "row2" : ($currow = "row1");
     }
     $counter++;
 }
Example #6
0
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'] = '&nbsp;';
        if ($columnstodisplay['expand']) {
            $txt = '';
            if ($root->hasChildren()) {
                if (!in_array($one->Id(), $openedArray)) {
                    $txt .= "<a href=\"{$thisurl}&amp;content_id=" . $one->Id() . "&amp;col=0&amp;page=" . $page . "\" onclick=\"xajax_content_toggleexpand(" . $one->Id() . ", 'false'); return false;\">";
                    $txt .= $expandImg;
                    $txt .= "</a>";
                } else {
                    $txt .= "<a href=\"{$thisurl}&amp;content_id=" . $one->Id() . "&amp;col=1&amp;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'] = '&nbsp;';
            $txt = '';
            if ($one->mMenuText != CMS_CONTENT_HIDDEN_NAME) {
                if ($indent) {
                    for ($i = 0; $i < $root->getLevel(); $i++) {
                        $txt .= "-&nbsp;&nbsp;&nbsp;";
                    }
                }
                if ($display == 'edit') {
                    $txt .= '<a href="editcontent.php' . $urlext . '&amp;content_id=' . $one->mId . '&amp;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'] = '&nbsp;';
            $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 . "&amp;template_id=" . $one->TemplateId() . "&amp;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'] = '&nbsp;';
            if ($one->Owner() > -1) {
                $columns['owner'] = $users[$one->Owner()]->username;
            }
        }
        /* active column */
        if ($columnstodisplay['active']) {
            $columns['active'] = '&nbsp;';
            $txt = '';
            if (check_permission($userid, 'Manage All Content') && $one->Type() != 'errorpage') {
                if ($one->Active()) {
                    $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&amp;setinactive=" . $one->Id() . "\" onclick=\"xajax_content_setinactive(" . $one->Id() . ");return false;\">" . $image_set_false . "</a>";
                } else {
                    $txt = "<a href=\"{$thisurl}&amp;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'] = '&nbsp;';
            $txt = '';
            if (check_permission($userid, 'Manage All Content')) {
                if ($one->IsDefaultPossible()) {
                    $txt = $one->DefaultContent() ? $image_true : "<a href=\"{$thisurl}&amp;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'] = '&nbsp;';
            $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}&amp;direction=down&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                        $txt .= $downImg;
                        $txt .= "</a>&nbsp;&nbsp;";
                    } else {
                        if ($one->ItemOrder() - 1 == $sameLevel - 1) {
                            $txt .= "&nbsp;&nbsp;<a class=\"move_up\" onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&amp;direction=up&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                            $txt .= $upImg;
                            $txt .= "</a>";
                        } else {
                            $txt .= "<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'down'); return false;\" href=\"{$thisurl}&amp;direction=down&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;page=" . $page . "\">";
                            $txt .= $downImg;
                            $txt .= "</a>&nbsp;<a onclick=\"xajax_content_move(" . $one->Id() . ", " . $one->ParentId() . ", 'up'); return false;\" href=\"{$thisurl}&amp;direction=up&amp;content_id=" . $one->Id() . "&amp;parent_id=" . $one->ParentId() . "&amp;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'] = '&nbsp;';
            $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'] = '&nbsp;';
            $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 . '&amp;content_id=' . $one->Id() . '">';
                $txt .= $copyImg . "</a>";
            }
            if (!empty($txt)) {
                $columns['copy'] = $txt;
            }
        }
        /* edit column */
        if ($columnstodisplay['edit']) {
            $columns['edit'] = '&nbsp;';
            $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 . "&amp;content_id=" . $one->Id() . "\">";
                $txt .= $editImg;
                $txt .= "</a>";
            }
            if (!empty($txt)) {
                $columns['edit'] = $txt;
            }
        }
        /* delete column */
        if ($columnstodisplay['delete']) {
            $columns['delete'] = '&nbsp;';
            $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}&amp;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'] = '&nbsp;';
            $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);
        }
    }
}
Example #7
0
     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 . "&amp;template_id=" . $one["assoc_to_id"] . "&amp;from=cssassoc&amp;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 . "&amp;id=" . $id . "&amp;template_id=" . $one["assoc_to_id"] . "&amp;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>&nbsp;</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
Example #8
0
             echo $themeObject->DisplayImage('icons/system/copy.gif', lang('copy'), '', '', 'systemicon');
             echo "</a></td>\n";
         } else {
             echo "<td>&nbsp;</td>";
         }
         // if user has right to edit
         if ($modify) {
             echo "<td class=\"icons_wide\"><a href=\"editcss.php" . $urlext . "&amp;css_id=" . $one["css_id"] . "\">";
             echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'), '', '', 'systemicon');
             echo "</a></td>\n";
         } else {
             echo "<td>&nbsp;</td>";
         }
         // if user has right to delete
         if ($delcss) {
             echo "<td class=\"icons_wide\"><a href=\"deletecss.php" . $urlext . "&amp;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>&nbsp;</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++;
 }
Example #9
0
    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 . "&amp;bookmark_id=" . $onemark->bookmark_id . "\">" . $onemark->title . "</a></td>\n";
            echo "<td>" . $onemark->url . "</td>\n";
            echo "<td><a href=\"editbookmark.php" . $urlext . "&amp;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 . "&amp;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 
Example #10
0
                }
            }
            echo "</td>\n";
            if ($perm) {
                echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupperm.php" . $urlext . "&amp;group_id=" . $onegroup->id . "\">" . $image_permissions . "</a></td>\n";
            }
            if ($assign) {
                echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupassign.php" . $urlext . "&amp;group_id=" . $onegroup->id . "\">" . $image_groupassign . "</a></td>\n";
            }
            if ($edit) {
                echo "<td class=\"icons_wide\"><a href=\"editgroup.php" . $urlext . "&amp;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 . "&amp;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">&nbsp;</td>' . "\n";
            }
            echo "</tr>\n";
            $currow == "row1" ? $currow = "row2" : ($currow = "row1");
        }
        $counter++;
    }
    echo '</tbody>';
    echo "</table>\n";
}
if (check_permission($userid, 'Add Groups')) {
    ?>
Example #11
0
         $url = "editcss.php" . $urlext . "&amp;css_id=" . $row['assoc_css_id'] . "&amp;from=templatecssassoc&amp;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 . '&amp;dir=down&amp;cssid=' . $row['assoc_css_id'] . '&amp;id=' . $id . '&amp;type=template';
             $upurl = 'listcssassoc.php' . $urlext . '&amp;dir=up&amp;cssid=' . $row['assoc_css_id'] . '&amp;id=' . $id . '&amp;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 . "&amp;id={$id}&amp;css_id=" . $row["assoc_css_id"] . "&amp;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},";
 }