slides-list.php
7.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php if( !defined( 'ABSPATH') ) exit(); ?>
<div class="postbox box-slideslist">
<div class="title_line nobgnopd">
<div class="view_title"><?php _e('Post List',REVSLIDER_TEXTDOMAIN); ?>
<span id="saving_indicator" class='slideslist-loading'><?php _e('Saving Order',REVSLIDER_TEXTDOMAIN); ?>...</span>
</div>
</div>
<div class="inside">
<?php if(empty($arrSlides)){ _e('No Posts Found',REVSLIDER_TEXTDOMAIN); } ?>
<ul id="list_slides" class="list_slides ui-sortable">
<?php
$counter = 0;
foreach($arrSlides as $slide){
$counter++;
$bgType = $slide->getParam("background_type","image");
$bgFit = $slide->getParam("bg_fit","cover");
$bgFitX = intval($slide->getParam("bg_fit_x","100"));
$bgFitY = intval($slide->getParam("bg_fit_y","100"));
$bgPosition = $slide->getParam("bg_position","center center");
$bgPositionX = intval($slide->getParam("bg_position_x","0"));
$bgPositionY = intval($slide->getParam("bg_position_y","0"));
$bgRepeat = $slide->getParam("bg_repeat","no-repeat");
$bgStyle = ' ';
if($bgFit == 'percentage'){
$bgStyle .= "background-size: ".$bgFitX.'% '.$bgFitY.'%;';
}else{
$bgStyle .= "background-size: ".$bgFit.";";
}
if($bgPosition == 'percentage'){
$bgStyle .= "background-position: ".$bgPositionX.'% '.$bgPositionY.'%;';
}else{
$bgStyle .= "background-position: ".$bgPosition.";";
}
$bgStyle .= "background-repeat: ".$bgRepeat.";";
//set language flag url
$isWpmlExists = RevSliderWpml::isWpmlExists();
$useWpml = $slider->getParam("use_wpml","off");
$showLangs = false;
if($isWpmlExists && $useWpml == "on"){
$showLangs = true;
$arrChildLangs = $slide->getArrChildrenLangs();
$arrSlideLangCodes = $slide->getArrChildLangCodes();
$addItemStyle = "";
if(RevSliderWpml::isAllLangsInArray($arrSlideLangCodes))
$addItemStyle = "style='display:none'";
}
$imageFilepath = $slide->getImageFilepath();
$urlImageForView = $slide->getThumbUrl();
$slideTitle = $slide->getParam("title","Slide");
$title = $slideTitle;
$filename = $slide->getImageFilename();
$imageAlt = stripslashes($slideTitle);
if(empty($imageAlt))
$imageAlt = "slide";
if($bgType == "image")
$title .= " (".$filename.")";
$slideid = $slide->getID();
$urlEditSlide = self::getViewUrl(RevSliderAdmin::VIEW_SLIDE,"id=$slideid");
$linkEdit = RevSliderFunctions::getHtmlLink($urlEditSlide, $title);
$state = $slide->getParam("state","published");
?>
<li id="slidelist_item_<?php echo $slideid; ?>" class="ui-state-default">
<span class="slide-col col-order">
<span class="order-text"><?php echo $counter; ?></span>
<div class="state_loader" style="display:none;"></div>
<?php
if($state == "published"){
?>
<div class="icon_state state_published" data-slideid="<?php echo $slideid; ?>" title="<?php _e("Unpublish Slide",REVSLIDER_TEXTDOMAIN); ?>"></div>
<?php
}else{
?>
<div class="icon_state state_unpublished" data-slideid="<?php echo $slideid; ?>" title="<?php _e("Publish Slide",REVSLIDER_TEXTDOMAIN); ?>"></div>
<?php
}
?>
<div class="icon_slide_preview" title="<?php _e('Preview Slide', REVSLIDER_TEXTDOMAIN); ?>" data-slideid="<?php echo $slideid; ?>"></div>
</span>
<span class="slide-col col-name">
<div class="slide-title-in-list"><?php echo $linkEdit; ?></div>
<a class='button-primary revgreen' href='<?php echo $urlEditSlide; ?>' style="width:120px; "><i class="revicon-pencil-1"></i><?php _e("Edit Slide",REVSLIDER_TEXTDOMAIN); ?></a>
</span>
<span class="slide-col col-image">
<?php
switch($bgType){
default:
case "image":
?>
<div id="slide_image_<?php echo $slideid; ?>" style="background-image:url('<?php echo $urlImageForView; ?>');<?php echo $bgStyle; ?>" class="slide_image" title="<?php _e('Slide Image - Click to change', REVSLIDER_TEXTDOMAIN); ?>"></div>
<?php
break;
case "solid":
$bgColor = $slide->getParam("slide_bg_color","#d0d0d0");
?>
<div class="slide_color_preview" style="background-color:<?php echo $bgColor; ?>"></div>
<?php
break;
case "trans":
?>
<div class="slide_color_preview_trans"></div>
<?php
break;
}
?>
</span>
<span class="slide-col col-operations">
<a id="" class='button-primary revred button_delete_slide ' style="width:120px; margin-top:8px !important" data-slideid="<?php echo $slideid; ?>" href='javascript:void(0)'><i class="revicon-trash"></i><?php _e("Delete",REVSLIDER_TEXTDOMAIN); ?></a>
<span class="loader_round loader_delete" style="display:none;"><?php _e("Deleting Slide...",REVSLIDER_TEXTDOMAIN); ?></span>
<a id="button_duplicate_slide_<?php echo $slideid?>" style="width:120px; " class='button-primary revyellow button_duplicate_slide' href='javascript:void(0)'><i class="revicon-picture"></i><?php _e("Duplicate",REVSLIDER_TEXTDOMAIN); ?></a>
<?php
$copyButtonClass = "button-primary revblue button_copy_slide";
$copyButtonTitle = __("Open copy / move dialog",REVSLIDER_TEXTDOMAIN);
if($numSliders == 0){
$copyButtonClass .= " button-disabled";
$copyButtonTitle = "Copy / move disabled, no more sliders found";
}
?>
<a id="button_copy_slide_<?php echo $slideid; ?>" class='<?php echo $copyButtonClass; ?>' title="<?php echo $copyButtonTitle; ?>" style="width:120px; " href='javascript:void(0)'><i class="revicon-picture"></i><?php _e("Copy / Move",REVSLIDER_TEXTDOMAIN); ?></a>
<span class="loader_round loader_copy mtop_10 mleft_20 display_block" style="display:none;"><?php _e("Working...",REVSLIDER_TEXTDOMAIN); ?></span>
</span>
<span class="slide-col col-handle">
<div class="col-handle-inside">
<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
</div>
</span>
<div class="clear"></div>
<?php
if($showLangs == true){
?>
<ul class="list_slide_icons">
<?php
foreach($arrChildLangs as $arrLang){
$isParent = RevSliderFunctions::boolToStr($arrLang["isparent"]);
$childSlideID = $arrLang["slideid"];
$lang = $arrLang["lang"];
$urlFlag = RevSliderWpml::getFlagUrl($lang);
$langTitle = RevSliderWpml::getLangTitle($lang);
?>
<li>
<img id="icon_lang_<?php echo $childSlideID; ?>" class="icon_slide_lang" src="<?php echo $urlFlag; ?>" title="<?php echo $langTitle; ?>" data-slideid="<?php echo $childSlideID; ?>" data-lang="<?php echo $lang; ?>" data-isparent="<?php echo $isParent; ?>">
<div class="icon_lang_loader loader_round" style="display:none"></div>
</li>
<?php
}
?>
<li>
<div id="icon_add_lang_<?php echo $slideid; ?>" class="icon_slide_lang_add" data-operation="add" data-slideid="<?php echo $slideid; ?>" <?php echo $addItemStyle; ?>></div>
<div class="icon_lang_loader loader_round" style="display:none"></div>
</li>
</ul>
<?php
}
?>
</li>
<?php
}
?>
</ul>
</div>
</div>