Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/templates/default/video_category.tpl.php
Строк: 377
<?php defined('_VALID') or die('Restricted Access!'); ?>
    <?php echo $this->fetch('errors'); ?>
    <?php echo $this->fetch('messages'); ?>
    <?php echo $this->fetch('warnings'); ?>
    <link href="<?php echo TPL_REL?>/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <script src="<?php echo TPL_REL?>/js/jquery-ui-1.8.16.custom.min.js"></script>    
    <script type="text/javascript">
    var lang_question_suspend = "Are you sure you want to suspend this video category?";
    var lang_question_activate = "Are you sure you want to activate this video category?";
    var lang_question_delete = "Are you sure you want to delete this video category?";
    var lang_question_unassign = "Are you sure you want to remove the assigned advertising from this video category?";
    $(document).ready(function() {
        $("a[id^='manage_category_']").click(function(e) {
            e.preventDefault();
            var click_id    = $(this).attr('id');
            var click_arr   = click_id.split('_');
            var action      = click_arr[2];
            var cat_id      = click_arr[3];
            var answer      = false;
            if (action == 'suspend') {
                var answer = confirm(lang_question_suspend);
            } else if (action == 'activate') {
                var answer = confirm(lang_question_activate);
            } else if (action == 'delete') {
                var answer  = confirm(lang_question_delete);
            } else if (action == 'unassign') {
                  var answer  = confirm(lang_question_unassign);
            }
            
            if (answer) {
                $("input[name='action']").val(action);
                $("input[name='cat_id']").val(cat_id);
                $("#manage_category_form").submit();
            }
        });

        $("#dialog-category-adv").dialog({
            autoOpen: false,
            width: 700,
            height: 540,
            buttons: {
                "Update": function() {
                    var args = $("#manage-category-form").serializeArray();
                    $.ajax({
                        url: base_url + '/ajax.php?s=manage_category&d=backend',
                        cache: false,
                        type: "POST",
                        dataType: "json",
                        data: {options: $.param(args)}
                    });
                    $(this).dialog('close');
                }
            }
        });

        $("a[id^='manage_adv_']").live('click', function(e) {
            e.preventDefault();
            
            var cat_id = $(this).attr('id').match(/manage_adv_(.*)/)[1];

            $.ajax({
                url: base_url + '/ajax.php?s=manage_category&d=backend',
                cache: false,
                type: "POST",
                dataType: "json",
                data: {cat_id: cat_id},
                success: function(response) {
                    $("#dialog-category-adv").html(response.code);
                    $("#dialog-category-adv").dialog('open');
                }
            });
        });        
        
        $("#dialog-player-adv").dialog({
            autoOpen: false,
            width: 600,
            height: 340,
            buttons: {
                "Update": function() {
                    var args = $("#manage-player-form").serializeArray();
                    $.ajax({
                        url: base_url + '/ajax.php?s=manage_player_category&d=backend',
                        cache: false,
                        type: "POST",
                        dataType: "json",
                        data: {options: $.param(args)}
                    });
                    $(this).dialog('close');
                }
            }
          });

       $("#dialog-embed-adv").dialog({
            autoOpen: false,
            width: 700,
            height: 340,
            buttons: {
                "Update": function() {
                    var args = $("#manage-embed-form").serializeArray();
                    $.ajax({
                        url: base_url + '/ajax.php?s=manage_embed_category&d=backend',
                        cache: false,
                        type: "POST",
                        dataType: "json",
                        data: {options: $.param(args)}
                    });
                    $(this).dialog('close');
                }
            }
        });

       $("a[id^='manage_player_']").live('click', function(e) {
            e.preventDefault();
            
            var cat_id = $(this).attr('id').match(/manage_player_(.*)/)[1];

            $.ajax({
                url: base_url + '/ajax.php?s=manage_player_category&d=backend',
                cache: false,
                type: "POST",
                dataType: "json",
                data: {cat_id: cat_id},
                success: function(response) {
                    $("#dialog-player-adv").html(response.code);
                    $("#dialog-player-adv").dialog('open');
                }
            });
        });        

       $("a[id^='manage_embed_']").live('click', function(e) {
            e.preventDefault();
            
            var cat_id = $(this).attr('id').match(/manage_embed_(.*)/)[1];

            $.ajax({
                url: base_url + '/ajax.php?s=manage_embed_category&d=backend',
                cache: false,
                type: "POST",
                dataType: "json",
                data: {cat_id: cat_id},
                success: function(response) {
                    $("#dialog-embed-adv").html(response.code);
                    $("#dialog-embed-adv").dialog('open');
                }
            });
        });
        
        $("#dialog-adv").dialog({
            autoOpen: false,
            width: 600,
            height: 410,
            modal: true,
            resizable: false,           
            buttons: { 
                "Assign": function() {
                    $(this).dialog("close");

                    var ids = $("input[name^='checkbox_category_']:checked");
                    ids = $.param(ids).replace(/checkbox_category_/g, '');
                    
                    var id = $("input[name='adv']:checked").val();
                    
                    $("input[name='sub_action']").val('assign');
                    $("input[name='sub_id']").val(id);
                    $("input[name='sub_ids']").val(ids);
                    
                    $("#sub_form").submit();
                },
                "Cancel": function() {
                    $(this).dialog("close");                    
                }
            }
        });
        
        $("#actionsForm").submit(function(e) {
              var action = $("select[name='action']").val();
              if (action == 'assign') {
                  e.preventDefault();
                  $("#dialog-adv").dialog('open');
              }
        });
    }); 
    </script>    
    <div id="container" class="clearfix">
        <div id="page">
            <?php echo $this->fetch('video_menu'); ?>
            <div class="content clearfix">
                <?php echo $this->fetch('video_category_menu'); ?>
                <?php if ($this->categories): ?>
                <form name="manage_category_form" id="manage_category_form" method="post" action="<?php echo CURRENT_URL?>">
                    <input name="action" type="hidden" value="" />
                    <input name="cat_id" type="hidden" value="" />
                </form>
                <form id="sub_form" method="post" action="<?php echo CURRENT_URL?>">
                    <input name="sub_id" type="hidden" value="" />
                    <input name="sub_ids" type="hidden" value="" />
                    <input name="sub_action" type="hidden" value="1" />
                </form>                
                <form name="actionsForm" id="actionsForm" method="post" action="<?php echo CURRENT_URL?>">
                <div class="box_menu">
                    <div class="box_menu_left">
                        <select name="action" id="actions_top">
                              <option value="suspend">Suspend</option>
                              <option value="activate">Activate</option>
                              <option value="delete">Delete</option>
                              <option value="assign">Assign Advertising</option>
                              <option value="unassign">Unassign Advertising</option>
                        </select>
                        <input name="submit_actions" type="submit" class="button butDef" value="Go!" />
                    </div>
                    <div class="box_menu_right">
                    </div>
                    <div class="clear"></div>
                </div>
                <div id="dialog-category-adv" title="Manage per Category Advertising" style="display: none;"></div>
                <div id="dialog-player-adv" title="Manage Player Advertising" style="display: none;"></div>
                <div id="dialog-embed-adv" title="Manage Embedded Player Advertising" style="display: none;"></div>
                <div id="dialog-adv" title="Assign Video Player Advertising to Selected Categories" style="display: none;">
                <?php if ($this->advs): ?>  
                <ul class="dialog-list">
                      <?php foreach ($this->advs as $adv): ?>
                    <li><input name="adv" type="radio" id="adv-<?php echo $adv['adv_id']; ?>" class="radio" value="<?php echo $adv['adv_id']; ?>" /> <?php echo e($adv['adv_name']); ?></li>
                    <?php endforeach; ?>
                </ul>
                <?php else: ?>
                <div class="none">No advertising banners found for the Video Player Group! Click <a href="<?php echo ADMIN_URL?>/index.php?q=adv/add">here</a> to add banners!</div>
                <?php endif; ?>
                </div>
                <table cellpadding="0" cellspacing="0" border="0" id="table" class="uiTable">
                    <thead>
                          <tr>
                              <th class="nosort" style="width: 12px; text-align: center;"><input name="checkbox_all" type="checkbox" id="check_all" /></th>
                            <th><h3>Name</h3></th>
                            <th><h3>Slug</h3></th>
                            <th><h3>Parent</h3></th>
                            <th><h3>Videos</h3></th>
                            <th><h3>Status</h3></th>
                            <th><h3>Actions</h3></th>
                        </tr>
                    </thead>
                    <tbody>
                          <?php foreach ($this->categories as $category):
                          if (
$category['status'] == '1'):
                              
$status_image 'accept.png';
                            
$status 'suspend';
                        else:
                            
$status_image 'cancel.png';
                            
$status 'activate';
                        endif; 
?>
                          <tr id="row_<?php echo $category['cat_id']; ?>">
                              <td><input name="checkbox_category_<?php echo $category['cat_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $category['cat_id']; ?>" /></td>
                              <td>
                                  <a href="<?php echo ADMIN_URL?>/index.php?q=video/manage&amp;c=<?php echo $category['cat_id']; ?>"><?php echo e($category['name']); ?><br /><img src="<?php echo MEDIA_URL?>/videos/cat/<?php echo $category['cat_id']; ?>.jpg" width="80" alt="" /></a>
                                  
                              </td>
                              <td><strong><?php echo e($category['slug']); ?></strong></td>
                              <td><?php if ($category['parent_id'] == '0'): echo 'None'; else: echo '<strong>',$this->parents[$category['parent_id']],'</strong>'; endif; ?></td>
                              <td><?php echo $category['total_videos']; ?></td>
                              <td><a href="#status" id="manage_category_<?php echo $status?>_<?php echo $category['cat_id']; ?>" title="Click to <?php if ($category['status'] == '0'): echo 'activate'; else: echo 'suspend'; endif; ?> this menu!"><img src="<?php echo TPL_REL?>/images/<?php echo $status_image?>" /></a></td>
                              <td>
                                  <a href="<?php echo ADMIN_URL?>/index.php?q=video/category/edit&amp;id=<?php echo $category['cat_id']; ?>" id="edit_category_<?php echo $category['cat_id']; ?>"><img src="<?php echo TPL_REL?>/images/folder_edit.png" alt="Edit" /></a>&nbsp;
                                <a href="#delete" id="manage_category_delete_<?php echo $category['cat_id']; ?>" title="Click to delete this video category!"><img src="<?php echo TPL_REL?>/images/folder_delete.png" alt="Delete" /></a>&nbsp;<br />
                                <a href="#manage_category" id="manage_adv_<?php echo $category['cat_id']; ?>" title="Manage Category Advertising"><img src="<?php echo TPL_REL?>/images/coins.png" alt="" /></a>
                                <a href="#manage_player" id="manage_player_<?php echo $category['cat_id']; ?>" title="Manage Player Advertising"><img src="<?php echo TPL_REL?>/images/shape_square_edit.png" alt="" /></a>
                                <a href="#manage_embed" id="manage_embed_<?php echo $category['cat_id']; ?>" title="Manage Embedded Player Advertising"><img src="<?php echo TPL_REL?>/images/overlays.png" alt="" /></a>
                              </td>
                          </tr>
                          <?php endforeach; ?>
                    </tbody>
                </table>
                <div class="box_menu">
                    <div class="box_menu_left">
                        <select name="action" id="actions_bottom">
                              <option value="suspend">Suspend</option>
                              <option value="activate">Activate</option>
                              <option value="delete">Delete</option>
                              <option value="assign">Assign Advertising</option>
                              <option value="unassign">Unassign Advertising</option>
                        </select>
                        <input name="submit_actions" type="submit" class="button butDef" value="Go!" />
                    </div>
                    <div class="box_menu_right">
                    </div>
                    <div class="clear"></div>
                </div>
                </form>
                <?php else: ?>
                <div class="none">No categories found! Click <a href="<?php echo ADMIN_URL?>/index.php?q=video/category_add">here</a> to add categories!</div>
                <?php endif; ?>
            </div>
               <div class="legend">
                    <img src="<?php echo TPL_REL?>/images/folder_edit.png" alt="category_edit" /> Edit Category &nbsp;
                    <img src="<?php echo TPL_REL?>/images/folder_delete.png" alt="category_delete" /> Delete Category &nbsp;
                    <img src="<?php echo TPL_REL?>/images/coins_add.png" alt="coins_add" /> Assign Advertising &nbsp;
                    <img src="<?php echo TPL_REL?>/images/coins_delete.png" alt="coins_delete" /> Remove Advertising &nbsp;
                    <img src="<?php echo TPL_REL?>/images/shape_square_edit.png" alt="shape square edit" /> Manage Player Advertising<br />
                    <img src="<?php echo TPL_REL?>/images/overlays.png" alt="overlays" /> Manage Embedded Player Advertising &nbsp;
                    <img src="<?php echo TPL_REL?>/images/accept.png" alt="accept" /> Active - Action Suspend &nbsp;
                    <img src="<?php echo TPL_REL?>/images/cancel.png" alt="cancel" /> Suspended - Action Activate
                </div>
        </div>
    </div>
Онлайн: 0
Реклама