function _showFormButtons()
{
    ?>
  <div style="float: right">
    <input class="button" type="submit" name="save" value="<?php 
    et('Save');
    ?>
"  /><!-- form saved via ajax on submit, see js file) -->
    <input class="button" type="button" onclick="$('#saveAndCopy').val(1); $('form').submit();" value="<?php 
    echo eht('Save & Copy');
    ?>
"  />
    <input class="button" type="button" onclick="self.parent.tb_remove()" value="<?php 
    et('Cancel');
    ?>
"  />
  </div>
<?php 
}
function cg2_detailpage_getOptions($function, $name, $description, $type)
{
    // error checking
    if (@$_REQUEST['_showCode']) {
        $errorsAndAlerts = '';
        if (!@$_REQUEST['tableName']) {
            alert(t("Please select a section!") . "<br />\n");
        }
        if (!@$_REQUEST['whichRecord']) {
            alert(t("Please select a value for 'which record'") . "!<br />\n");
        }
        if (!alert()) {
            return;
        }
        // if form submitted and no errors than return and generate code
    }
    // set form defaults
    $defaults['whichRecord'] = '';
    $defaults['recordNumCustom'] = '1';
    $defaults['showUploads'] = 'all';
    $defaults['showUploadsCount'] = '1';
    foreach ($defaults as $key => $value) {
        if (!array_key_exists($key, $_REQUEST)) {
            $_REQUEST[$key] = $value;
        }
    }
    // show header
    echo cg2_header($function, $name);
    print "<input type='hidden' name='_showCode' value='1' />\n";
    ?>


<div class="code-generator" style="display: block; ">

<?php 
    cg2_option_selectSection();
    ?>

  <div class='content-box content-box-divider'>
    <div class='content-box-header'><h3><?php 
    eht("Viewer Options");
    ?>
</h3></div>
  </div>

  <div class="fieldOption">
    <div class="label"><?php 
    et('Which Record');
    ?>
</div>
    <div style="float:left; line-height: 1.5em">

        <label>
          <?php 
    echo cg2_inputRadio('whichRecord', 'first');
    ?>
          <?php 
    et("Single record sections: Load first record in database");
    ?>
        </label><br/>

        <label>
          <?php 
    echo cg2_inputRadio('whichRecord', 'url');
    ?>
          <?php 
    et("Multi record sections: Get record # from end of url. eg: viewer.php?record_title-3");
    ?>
        </label><br/>

        <label>
          <?php 
    echo cg2_inputRadio('whichRecord', 'custom');
    ?>
          <?php 
    echo sprintf(t('Custom: Load record # %s'), cg2_inputText('recordNumCustom', 6));
    ?>
        </label><br/><br/>
    </div>
    <div class="clear"></div>
  </div>


<?php 
    cg2_option_uploads();
    ?>

  <div align="center" style="padding-right: 5px" class="fieldOption"><input class="button" type="submit" name="_null_" value="<?php 
    echo t('Show Code &gt;&gt;');
    ?>
 " /></div>
</div>


<?php 
    echo cg2_footer();
    exit;
}
function cg2_rssfeed_getOptions($function, $name, $description, $type)
{
    // error checking
    if (@$_REQUEST['_showCode']) {
        $errorsAndAlerts = '';
        if (!@$_REQUEST['tableName']) {
            alert("Please select a section!<br />\n");
        }
        if (!@$_REQUEST['feedTitle']) {
            alert("Please enter a value for Feed Title!<br />\n");
        }
        if (!@$_REQUEST['feedLink']) {
            alert("Please enter a value for Feed Link!<br />\n");
        }
        if (!@$_REQUEST['feedDescription']) {
            alert("Please enter a value for Feed Description!<br />\n");
        }
        if (!@$_REQUEST['feedLanguage']) {
            alert("Please enter a value for Feed Language!<br />\n");
        }
        if (!@$_REQUEST['titleField']) {
            alert("Please select a title field!<br />\n");
        }
        if (!@$_REQUEST['descriptionField']) {
            alert("Please enter a description field!<br />\n");
        }
        if (!alert()) {
            // if no other errors, check fields exist in schema
            $schema = loadSchema($_REQUEST['tableName']);
            if (!in_array($_REQUEST['titleField'], array_keys($schema))) {
                alert("Invalid field '" . htmlencode($_REQUEST['titleField']) . "' selected!<br/>\n");
            }
            if (!in_array($_REQUEST['descriptionField'], array_keys($schema))) {
                alert("Invalid field '" . htmlencode($_REQUEST['descriptionField']) . "' selected!<br/>\n");
            }
        }
        if (!alert()) {
            return;
        }
        // if form submitted and no errors than return and generate code
    }
    // set form defaults
    $defaults['howMany'] = 'all';
    $defaults['limit'] = 25;
    $defaults['feedTitle'] = "Name of your site or RSS feed";
    $defaults['feedLink'] = "http://www.example.com/";
    $defaults['feedDescription'] = 'Your site description goes here';
    $defaults['feedLanguage'] = 'en-us';
    $defaults['titleField'] = '';
    $defaults['descriptionField'] = '';
    foreach ($defaults as $key => $value) {
        if (!array_key_exists($key, $_REQUEST)) {
            $_REQUEST[$key] = $value;
        }
    }
    // show header
    echo cg2_header($function, $name);
    print "<input type='hidden' name='_showCode' value='1' />\n";
    cg2_rssfeed_ajaxJsCode();
    // show ajax js code
    ?>
<div class="code-generator" style="display: block; ">

<?php 
    cg2_option_selectSection();
    ?>

  <div class='content-box content-box-divider'>
    <div class='content-box-header'><h3><?php 
    eht("Feed Options");
    ?>
</h3></div>
  </div>

  <div class="fieldOption">
    <div class="label"><?php 
    et('How Many');
    ?>
</div>
    <div style="float:left; line-height: 1.5em">
        <label>
          <?php 
    echo cg2_inputRadio('howMany', 'all');
    ?>
          <?php 
    et('Show all records');
    ?>
        </label><br/>

        <label>
          <?php 
    echo cg2_inputRadio('howMany', 'firstN');
    ?>
          <?php 
    echo sprintf(t('Show the first %s records only'), cg2_inputText('limit', 3));
    ?>
        </label><br/><br/>
    </div>
    <div class="clear"></div>
  </div>

<br/>

  <div class="fieldOption">
    <div class="label"><?php 
    et('Feed Title');
    ?>
</div>
    <?php 
    echo cg2_inputText('feedTitle', 60, true);
    ?>
  </div>

  <div class="fieldOption">
    <div class="label"><?php 
    et('Feed Link');
    ?>
</div>
    <?php 
    echo cg2_inputText('feedLink', 60, true);
    ?>
    <div class="clear"></div>
  </div>

  <div class="fieldOption">
    <div class="label"><?php 
    et('Feed Description');
    ?>
</div>
    <?php 
    echo cg2_inputText('feedDescription', 60, true);
    ?>
    <div class="clear"></div>
  </div>

  <div class="fieldOption">
    <div class="label"><?php 
    et('Feed Language');
    ?>
</div>
    <?php 
    echo cg2_inputText('feedLanguage', 60, true);
    ?>
    <div class="clear"></div>
  </div>

<br/><br/>

    <div class="fieldOption">
      <div class="label"><?php 
    et('Title field');
    ?>
</div>
      <?php 
    echo cg2_inputSchemaField('titleField');
    ?>
      <div class="clear"></div>
    </div>

    <div class="fieldOption">
      <div class="label"><?php 
    et('Description field');
    ?>
</div>
      <?php 
    echo cg2_inputSchemaField('descriptionField');
    ?>
      <div class="clear"></div>
    </div>

  <div align="center" style="padding-right: 5px" class="fieldOption"><input class="button" type="submit" name="_null_" value="<?php 
    echo t('Show Code &gt;&gt;');
    ?>
" /></div>
</div>


  <?php 
    echo cg2_footer();
    exit;
}
    function getTableRow($record, $value, $formType)
    {
        global $TABLE_PREFIX;
        // load access list
        $accessList = array();
        if (@$_REQUEST['num']) {
            $query = "SELECT * FROM `{$TABLE_PREFIX}_accesslist` WHERE userNum = '" . mysql_escape($_REQUEST['num']) . "'";
            $result = mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
            while ($record = mysql_fetch_assoc($result)) {
                $accessList[$record['tableName']] = $record;
            }
        }
        // get section list
        $sectionList = array();
        foreach (getSchemaTables() as $tableName) {
            $schema = loadSchema($tableName);
            $allowedMenuTypes = array('single', 'multi', 'category', 'menugroup', 'link', 'custom');
            if (!in_array(@$schema['menuType'], $allowedMenuTypes)) {
                continue;
            }
            $thisMenu = array();
            $thisMenu['menuName'] = htmlencode($schema['menuName']);
            if (@$schema['menuType'] != 'menugroup') {
                $thisMenu['menuName'] = '&nbsp; &nbsp; &nbsp;' . $thisMenu['menuName'];
            }
            if (@$schema['_indent']) {
                $thisMenu['menuName'] = '&nbsp; &nbsp; &nbsp;' . $thisMenu['menuName'];
            }
            $thisMenu['menuOrder'] = $schema['menuOrder'];
            $thisMenu['tableName'] = $tableName;
            $thisMenu['menuType'] = $schema['menuType'];
            array_push($sectionList, $thisMenu);
        }
        uasort($sectionList, '_sortMenusByOrder');
        // sort menus by order value
        // display field
        $allAccessLevel = @$accessList['all']['accessLevel'];
        $sectionsDivStyle = $allAccessLevel != 1 ? "display: none;" : '';
        //
        ob_start();
        ?>
 <tr>
  <td valign="top" style="padding-top: 2px"><?php 
        echo $this->label;
        ?>
</td>
  <td>

<table border="0" cellspacing="1" cellpadding="0">
<thead>
<tr>
<th width="305"><?php 
        et('Section Name');
        ?>
</th>
<th width="115" style="text-align: center"><?php 
        et('Access');
        ?>
</th>
<th width="100" style="text-align: center"><?php 
        et('Max Records');
        ?>
</th>
</tr>
</thead>
<tr>
<td class="listRow listRowOdd"><?php 
        et('All Sections');
        ?>
</td>
<td class="listRow listRowOdd" style="text-align: center">
  <select name="accessList[all][accessLevel]" style="width: 140px" onchange="(this.value=='1') ? $('.sectionAccessList').slideDown() : $('.sectionAccessList').slideUp();">
  <option value="0" <?php 
        selectedIf($allAccessLevel, '0');
        ?>
><?php 
        et('None');
        ?>
</option>
  <option value="3" <?php 
        selectedIf($allAccessLevel, '3');
        ?>
><?php 
        et('Viewer');
        ?>
</option>
  <option value="6" <?php 
        selectedIf($allAccessLevel, '6');
        ?>
><?php 
        et('Author');
        ?>
</option>
  <option value="7" <?php 
        selectedIf($allAccessLevel, '7');
        ?>
><?php 
        eht('Author & Viewer');
        ?>
</option>
  <option value="9" <?php 
        selectedIf($allAccessLevel, '9');
        ?>
><?php 
        et('Editor');
        ?>
</option>
  <option value="1" <?php 
        selectedIf($allAccessLevel, '1');
        ?>
><?php 
        et('By Section');
        ?>
</option>
  </select>
</td>
<td class="listRow listRowOdd" style="text-align: center"><?php 
        et('No Limit');
        ?>
</td>
</tr>
</table>

<script type="text/javascript">
function toggleDisabledForAccessListMaxRecords(tablename) {
var accessLevel = $("#accesslevel_"+tablename).val();
var disableMaxRecords = (accessLevel == 9 || accessLevel == 3);
if (disableMaxRecords) { $("#maxRecords_"+tablename).attr("disabled", true).css("background-color","#DDD");  }
else                   { $("#maxRecords_"+tablename).removeAttr("disabled").css("background-color","#FFF");  }
}
</script>

<div class="sectionAccessList" style="<?php 
        echo $sectionsDivStyle;
        ?>
">
<div style="width: 0px; height: 0px;"></div><?php 
        /* fixes IE7 issue which caused table to get no layout space, causing overlap and missing table content. the issue seems to be caused by a div with only a table inside. adding anything else inside the div seems to fix it, including &nbsp, but that adds extra whitespace, hence the div with no area */
        ?>
<table border="0" cellspacing="1" cellpadding="0">

<?php 
        // list sections
        foreach ($sectionList as $section) {
            $bgColorClass = @$bgColorClass == "listRowEven" ? 'listRowOdd' : 'listRowEven';
            # rotate bgclass
            $fieldnamePrefix = "accessList[{$section['tableName']}]";
            $accessLevel = @$accessList[$section['tableName']]['accessLevel'];
            $maxRecords = @$accessList[$section['tableName']]['maxRecords'];
            $disableMaxRecords = $accessLevel == 9 || $accessLevel == 3;
            $maxRecordsAttr = $disableMaxRecords ? 'style="text-align: center; background-color: #DDD;" disabled="disabled"' : 'style="text-align: center;"';
            ?>
<tr>
<td class="listRow <?php 
            echo $bgColorClass;
            ?>
" width="305">&nbsp;&nbsp;&nbsp;&nbsp;<?php 
            echo $section['menuName'];
            ?>
</td>
<td class="listRow <?php 
            echo $bgColorClass;
            ?>
" width="115" style="text-align: center">
<?php 
            if ($section['menuType'] == 'single' || $section['tableName'] == 'accounts' || $section['menuType'] == 'menugroup' || $section['menuType'] == 'link') {
                ?>
<input type="hidden"   name="<?php 
                echo $fieldnamePrefix;
                ?>
[accessLevel]" value="0" />
<input type="checkbox" name="<?php 
                echo $fieldnamePrefix;
                ?>
[accessLevel]" value="9" <?php 
                checkedIf($accessLevel, '9');
                ?>
 />
<?php 
            } elseif ($section['menuType'] == 'multi') {
                ?>
  <select name="<?php 
                echo $fieldnamePrefix;
                ?>
[accessLevel]" id="accesslevel_<?php 
                echo $section['tableName'];
                ?>
" style="width: 140px" onchange="toggleDisabledForAccessListMaxRecords('<?php 
                echo $section['tableName'];
                ?>
')">
  <option value="0" <?php 
                selectedIf($accessLevel, '0');
                ?>
><?php 
                et('None');
                ?>
</option>
  <option value="3" <?php 
                selectedIf($accessLevel, '3');
                ?>
><?php 
                et('Viewer');
                ?>
</option>
  <option value="6" <?php 
                selectedIf($accessLevel, '6');
                ?>
><?php 
                et('Author');
                ?>
</option>
  <option value="7" <?php 
                selectedIf($accessLevel, '7');
                ?>
><?php 
                eht('Author & Viewer');
                ?>
</option>
  <option value="9" <?php 
                selectedIf($accessLevel, '9');
                ?>
><?php 
                et('Editor');
                ?>
</option>
  </select>
<?php 
            } elseif ($section['menuType'] == 'category') {
                ?>
  <select name="<?php 
                echo $fieldnamePrefix;
                ?>
[accessLevel]" id="accesslevel_<?php 
                echo $section['tableName'];
                ?>
" style="width: 140px" onchange="toggleDisabledForAccessListMaxRecords('<?php 
                echo $section['tableName'];
                ?>
')">
  <option value="0" <?php 
                selectedIf($accessLevel, '0');
                ?>
><?php 
                et('None');
                ?>
</option>
  <option value="9" <?php 
                selectedIf($accessLevel, '9');
                ?>
><?php 
                et('Editor');
                ?>
</option>
  </select>
<?php 
            }
            ?>

</td>
<td class="<?php 
            echo $bgColorClass;
            ?>
" width="100" style="text-align: center">


<?php 
            if ($section['menuType'] == 'single') {
                printf(t("Single Page"));
            } elseif ($section['tableName'] == 'accounts') {
                ?>

<?php 
            } elseif ($section['menuType'] == 'multi') {
                ?>
  <input class="text-input medium-input" type="text" name="<?php 
                echo $fieldnamePrefix;
                ?>
[maxRecords]" id="maxRecords_<?php 
                echo $section['tableName'];
                ?>
"
         value="<?php 
                echo $maxRecords;
                ?>
" size="6" maxlength="6"
         <?php 
                echo $maxRecordsAttr;
                ?>
 />
<?php 
            }
            ?>
</td>

</tr>
<?php 
        }
        ?>

</table></div>


<br/><div style="font-size: 11px">
  <b><?php 
        et('Access Levels:');
        ?>
</b><br/>
  <div style="padding-left: 20px;">
    <?php 
        et('None - Don\'t allow user to access this section');
        ?>
<br/>
    <?php 
        et('Viewer - User can view any record in this section (must also be enabled in section editor)');
        ?>
<br/>
    <?php 
        et('Author - User can only access records they have created');
        ?>
<br/>
    <?php 
        eht("Author & Viewer - User can view any record and modify records they've created");
        ?>
<br/>
    <?php 
        et('Editor - User can access any records in this section');
        ?>
<br/>
  </div>
  <?php 
        et('Max Records: Max records user is allowed to create (for regular users only - leave blank for unlimited)');
        ?>
</div>

  </td>
 </tr>

<?php 
        $html = ob_get_clean();
        return $html;
    }
?>
        
        </div>
      </td>
    </tr>

    <tr><td colspan="2">&nbsp;</td></tr>




      <tr>
        <td colspan='2'>
          <div class='content-box content-box-divider'>
            <div class='content-box-header'><h3><?php 
eht("Server Info");
?>
</h3></div>
          </div>
        </td>
      </tr>



     <tr>
      <td width="192"><?php 
et('Operating System');
?>
&nbsp;</td>
      <td>
        <?php 
    }
}
?>

<div class="clear"></div>

<div class="content-box">
  <form method="post" action="?" autocomplete="off">

  <div class="content-box-header">
    <?php 
echo '<h3>' . t('Admin') . ' &gt; <a href="?menu=admin&amp;action=plugins">' . t('Plugins') . '</a> &gt; ' . t("Developer's Plugin Hook List") . '</h3>';
?>
    <div style="float:right;">
      <input class="button" type="button" name="null" value="<?php 
eht("Back to Plugins >>");
?>
" onclick="window.location='?menu=admin&amp;action=plugins'"/>
    </div>
    <div class="clear"></div>
  </div> <!-- End .content-box-header -->

  <div class="content-box-content">

    <div class="notification information png_bg"><div>
      <?php 
print sprintf(t("This page lists where Plugin Hooks are called and used. To learn more about a hook, open a file where it's called and search for the Hook Name."));
?>
    </div></div>

    <table cellspacing="0" class="data">