public static function plugin_categories($categories = null, $selected = null, $depth = 0)
 {
     if ($categories != null && is_array($categories)) {
         $d_string = '';
         for ($var_d = 0; $var_d < $depth; $var_d++) {
             $d_string .= "&nbsp;&nbsp;&nbsp;&nbsp;";
         }
         echo '<div id="cat' . $categories[0]['fk_i_parent_id'] . '">';
         foreach ($categories as $c) {
             echo $d_string . '<input type="checkbox" name="categories[]" value="' . $c['pk_i_id'] . '" onclick="javascript:checkCat(\'' . $c['pk_i_id'] . '\', this.checked);" ' . (in_array($c['pk_i_id'], $selected) ? 'checked' : '') . '>' . ($depth == 0 ? '<span style="font-size:25px">' : '') . $c['s_name'] . ($depth == 0 ? '</span>' : '') . '</input><br />';
             CategoryForm::plugin_categories($c['categories'], $selected, $depth + 1);
         }
         echo '</div>';
     }
 }
示例#2
0
">
                                        <label for="categories"><?php 
_e("Preset categories");
?>
</label><br />
                                        <a style="font-size: x-small; color: gray;" href="#" onclick="checkAll('frm3', true); return false;"><?php 
_e("Check all");
?>
</a> - <a style="font-size: x-small; color: gray;" href="#" onclick="checkAll('frm3', false); return false;"><?php 
_e("Uncheck all");
?>
</a>
                                    </td>
                                    <td>
                                        <?php 
CategoryForm::plugin_categories($categories, $selected);
?>
                                    </td>
                                </tr>
                            </table>
                        </p>
                        <p>
                            <input class="Button" type="button" onclick="window.history.go(-1);" value="<?php 
_e('Cancel');
?>
" />
                            <input class="Button" type="submit" value="<?php 
_e('Update');
?>
" />
                        </p>