Esempio n. 1
0
function dplink_adminmenu()
{
    $theme = pnUserGetTheme();
    pnThemeLoad($theme);
    // Create output object
    $output = new pnHTML();
    // Security check
    if (!pnSecAuthAction(0, 'dplink::', '::', ACCESS_ADMIN)) {
        $output->Text(pnVarPrepHTMLDisplay(_SHIMLINKNOAUTH));
        return $output->GetOutput();
    }
    //Title
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->Title(pnVarPrepHTMLDisplay('<b>' . _SHIMLINK . '</b>'));
    $output->Text(pnVarPrepHTMLDisplay(_SHIMLINKMODIFYCONFIG));
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    // Start form
    $output->FormStart(pnModURL('dplink', 'admin', 'updateconfig'));
    // Add an authorisation ID
    $output->FormHidden('authid', pnSecGenAuthKey());
    // Start the table that holds the information to be modified.
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->TableStart();
    // dplink location
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODSUBJECT));
    $row[] = $output->FormText('url', pnModGetVar('dplink', 'url'), 50, 50);
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Warning
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWARNING));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Use I-frame
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWRAP));
    $row[] = $output->FormCheckbox('use_wrap', pnModGetVar('dplink', 'use_wrap'));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Open in New >Window
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWINDOW));
    $row[] = $output->FormCheckbox('use_window', pnModGetVar('dplink', 'use_window'));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    $output->TableEnd();
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    // End form
    //$output->Linebreak(1);
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->Text('<div align="center"><br>');
    $output->FormSubmit(pnVarPrepHTMLDisplay(_SHIMLINKUPDATE));
    $output->Text('<br><br></div>');
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    $output->FormEnd();
    // Return the output that has been generated by this function
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    return $output->GetOutput();
}
Esempio n. 2
0
/**
 * This is a standard function to modify the configuration parameters of the
 * module
 */
function template_admin_modifyconfig()
{
    // Create output object - this object will store all of our output so that
    // we can return it easily when required
    $output = new pnHTML();
    // Security check - important to do this as early as possible to avoid
    // potential security holes or just too much wasted processing
    if (!pnSecAuthAction(0, 'Template::', '::', ACCESS_ADMIN)) {
        $output->Text(_TEMPLATENOAUTH);
        return $output->GetOutput();
    }
    // Add menu to output - it helps if all of the module pages have a standard
    // menu at their head to aid in navigation
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text(template_adminmenu());
    $output->SetInputMode(_PNH_PARSEINPUT);
    // Title - putting a title ad the head of each page reminds the user what
    // they are doing
    $output->Title(_TEMPLATEMODIFYCONFIG);
    // Start form - note the use of pnModURL() to create the recipient URL of
    // this form.  All URLs should be generated through pnModURL() to ensure
    // compatibility with future versions of PostNuke
    $output->FormStart(pnModURL('Template', 'admin', 'updateconfig'));
    // Add an authorisation ID - this adds a hidden field in the form that
    // contains an authorisation ID.  The authorisation ID is very important in
    // preventing certain attacks on the website
    $output->FormHidden('authid', pnSecGenAuthKey());
    // Start the table that holds the information to be modified.  Note how
    // each item in the form is kept logically separate in the code; this helps
    // to see which part of the code is responsible for the display of each
    // item, and helps with future modifications
    $output->TableStart();
    // Bold
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepForDisplay(_TEMPLATEDISPLAYBOLD));
    $row[] = $output->FormCheckbox('bold', pnModGetVar('Template', 'bold'));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    $output->SetInputMode(_PNH_PARSEINPUT);
    $output->Linebreak(2);
    // Number of items to display per page
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepForDisplay(_TEMPLATEITEMSPERPAGE));
    $row[] = $output->FormText('itemsperpage', pnModGetVar('Template', 'itemsperpage'), 3, 3);
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    $output->SetInputMode(_PNH_PARSEINPUT);
    $output->Linebreak(2);
    $output->TableEnd();
    // End form
    $output->Linebreak(2);
    $output->FormSubmit(_TEMPLATEUPDATE);
    $output->FormEnd();
    // Return the output that has been generated by this function
    return $output->GetOutput();
}