providers
5 years ago
class-fast-image.php
8 years ago
class-folders-walker.php
7 years ago
class-folders.php
5 years ago
class-frontend.php
5 years ago
class-galleries.php
5 years ago
class-multilang.php
5 years ago
class-remote-library-api.php
5 years ago
class-remote-library.php
5 years ago
class-settings.php
5 years ago
class-tour.php
5 years ago
class-welcome.php
5 years ago
class-widgets.php
5 years ago
functions.php
5 years ago
class-folders-walker.php
68 lines
| 1 | <?php |
| 2 | // exit if accessed directly |
| 3 | if ( ! defined( 'ABSPATH' ) ) |
| 4 | exit; |
| 5 | |
| 6 | class Responsive_Lightbox_Folders_Walker extends Walker { |
| 7 | |
| 8 | var $tree_type = 'category'; |
| 9 | var $db_fields = array( |
| 10 | 'parent' => 'parent', |
| 11 | 'id' => 'term_id' |
| 12 | ); |
| 13 | |
| 14 | /** |
| 15 | * Starts the list before the elements are added. |
| 16 | * |
| 17 | * @param string $output Passed by reference, used to append additional content |
| 18 | * @param int $depth Depth of the item |
| 19 | * @param array $args An array of additional arguments |
| 20 | */ |
| 21 | function start_lvl( &$output, $depth = 0, $args = array() ) { |
| 22 | $output .= str_repeat( "\t", $depth ) . "<ul class='children'>\n"; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Ends the list of after the elements are added. |
| 27 | * |
| 28 | * @param string $output Passed by reference, used to append additional content |
| 29 | * @param int $depth Depth of the item |
| 30 | * @param array $args An array of additional arguments |
| 31 | */ |
| 32 | function end_lvl( &$output, $depth = 0, $args = array() ) { |
| 33 | $output .= str_repeat( "\t", $depth ) . "</ul>\n"; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Start the element output. |
| 38 | * |
| 39 | * @param string $output Passed by reference, used to append additional content |
| 40 | * @param object $category The current term object |
| 41 | * @param int $depth Depth of the item |
| 42 | * @param array $args An array of additional arguments |
| 43 | * @param int $id ID of the current item |
| 44 | */ |
| 45 | function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
| 46 | extract( $args ); |
| 47 | |
| 48 | if ( empty( $taxonomy ) ) |
| 49 | $taxonomy = Visual_Folders()->options['general']['media_taxonomy']; |
| 50 | |
| 51 | $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; |
| 52 | |
| 53 | $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->slug . '" type="checkbox" name="' . $taxonomy . '_terms[' . $category->slug . ']" id="in-' . $taxonomy . '-' . $category->term_id . '" ' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . ' ' . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Ends the element output, if needed. |
| 58 | * |
| 59 | * @param string $output Passed by reference, used to append additional content |
| 60 | * @param object $category The current term object |
| 61 | * @param int $depth Depth of the item |
| 62 | * @param array $args An array of additional arguments |
| 63 | */ |
| 64 | function end_el( &$output, $category, $depth = 0, $args = array() ) { |
| 65 | $output .= "</li>\n"; |
| 66 | } |
| 67 | } |
| 68 |