Playlist messages added
Report message added
This commit is contained in:
parent
aef7736644
commit
5075dff238
4 changed files with 149 additions and 2 deletions
|
@ -1718,6 +1718,53 @@ if(!empty($mode))
|
|||
echo json_encode($array);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'photo_ajax':
|
||||
try{
|
||||
if(isset($_POST['photo'])) { // Exception Handling.
|
||||
$photo = $_POST['photo'];
|
||||
$params['details'] = $photo;
|
||||
$params['size'] = '_l'; // Size of an image.
|
||||
if(is_null($photo)) {
|
||||
throw new Exception("Value is not coming from the ajax call");
|
||||
}
|
||||
$img = get_photos($params['details']); // Getting photos.
|
||||
$srcString = BASEURL.'/files/photos/'.$photo['file_directory'].'/'.$photo['filename'].$params['size'].'.'.$photo['ext'];
|
||||
$photo_key = $photo['photo_key'];
|
||||
$response['src_string'] = $srcString; // Image Source.
|
||||
$response['photo_key'] = $photo_key; // Image key.
|
||||
echo json_encode($response); // Json Respons.
|
||||
}
|
||||
|
||||
if(isset($_POST['photo_pre']) || isset($_POST['photo_nxt'])) {
|
||||
if($_POST['photo_pre']) {
|
||||
$items ="prev";
|
||||
$photo = $_POST['photo_pre'];
|
||||
}
|
||||
if($_POST['photo_nxt']) {
|
||||
$items = "next";
|
||||
$photo = $_POST['photo_nxt'];
|
||||
}
|
||||
|
||||
$ci_id = $photo['ci_id']; // images order id.
|
||||
$collection = $photo['collection_id']; // collection id.
|
||||
$link = $cbcollection->get_next_prev_item($ci_id,$collection,$item=$items,$limit=1,$check_only=false); // getting Previous item
|
||||
$srcString = BASEURL.'/files/photos/'.$link[0]['file_directory'].'/'.$link[0]['filename'].$link[0]['size'].'.'.$link[0]['ext']; // Image Source...
|
||||
$photo_key = $link[0]['photo_key']; // Image Key.
|
||||
$response['photo'] = $link;
|
||||
$response['photo_key'] = $photo_key;
|
||||
$response['src_string'] = $srcString; // Image source.
|
||||
sleep(1);
|
||||
echo json_encode($response);
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception $e) {
|
||||
$response["error_ex"] = true;
|
||||
$response["msg"] = 'Message: ' .$e->getMessage(); // Error message..
|
||||
echo (json_encode($response));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
|
|
@ -2013,6 +2013,106 @@
|
|||
}
|
||||
},'text');
|
||||
};
|
||||
|
||||
this.flag_objectNew = function(form_id,id,type){
|
||||
var curObj = this;
|
||||
$("#flag_form_result").css("display","block");
|
||||
$("#flag_form_result").html(this.loading);
|
||||
$.post(page,
|
||||
{
|
||||
mode : 'flag_object',
|
||||
type : type,
|
||||
flag_type : $("#"+form_id+" select option:selected").val(),
|
||||
id : id
|
||||
},
|
||||
function(data)
|
||||
{
|
||||
if(!data)
|
||||
alert("No data");
|
||||
else
|
||||
{
|
||||
$("#flag_form_result").hide();
|
||||
curObj.showMeTheMsg(data);
|
||||
}
|
||||
},'text');
|
||||
};
|
||||
|
||||
this.add_playlistNew = function (mode,vid,form_id,objtype){
|
||||
curObj = this;
|
||||
$("#playlist_form_result").css("display","block");
|
||||
$("#playlist_form_result").html("loading");
|
||||
switch(mode)
|
||||
{
|
||||
case 'add':
|
||||
{
|
||||
$.post(page,
|
||||
{
|
||||
mode : 'add_playlist',
|
||||
id : vid,
|
||||
objtype : objtype,
|
||||
pid : $("#playlist_id option:selected").val()
|
||||
},
|
||||
function(data)
|
||||
{
|
||||
if(!data)
|
||||
alert("No data");
|
||||
else
|
||||
{
|
||||
if(data.err.length > 2)
|
||||
{
|
||||
cleanedHtml = $.parseHTML(data.err);
|
||||
var msg = $(cleanedHtml).html();
|
||||
curObj.throwHeaderr('danger',msg, 5000, true);
|
||||
}
|
||||
|
||||
if(data.msg.length > 2)
|
||||
{
|
||||
cleanedHtml = $.parseHTML(data.msg);
|
||||
var msg = $(cleanedHtml).html();
|
||||
curObj.throwHeaderr('success',msg, 5000, true);
|
||||
$("#"+form_id).css("display","none");
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
{
|
||||
|
||||
$.post(page,
|
||||
{
|
||||
mode : 'add_new_playlist',
|
||||
id : vid,
|
||||
objtype : objtype,
|
||||
plname : $("#playlist_name").val()
|
||||
},
|
||||
function(data)
|
||||
{
|
||||
if(!data)
|
||||
alert("No data");
|
||||
else
|
||||
{
|
||||
if(data.err )
|
||||
{
|
||||
$("#playlist_form_result").css("display","block");
|
||||
$("#playlist_form_result").html(data.err);
|
||||
}
|
||||
|
||||
if(data.msg)
|
||||
{
|
||||
$("#playlist_form_result").css("display","block");
|
||||
$("#playlist_form_result").html(data.msg);
|
||||
$("#"+form_id).css("display","none");
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
window._cb = new _cb();
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<div class="form-group clearfix">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<input type="button" class="btn mtm btn-block btn-primary" name="add_to_playlist" value="Add to playlist" class="cb_button" onclick="add_playlist('add','{$params.id}','add_playlist_form','{$type}')">
|
||||
<input type="button" class="btn mtm btn-block btn-primary" name="add_to_playlist" value="Add to playlist" class="cb_button" onclick="_cb.add_playlistNew('add','{$params.id}','add_playlist_form','{$type}')">
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<a class="btn btn-block mtm btn-success" href="javascript:void(0)" onClick="$('#add_playlist_form').css('display','none');$('#new_playlist_form').css('display','block')">{lang('create new playlist')}</a>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<input type="button" name="send_content" value="{sprintf(lang("Flag this %s"),$params.type)}" class="btn btn-primary" onclick="flag_object('flag_form','{$params.id}','{$params.type}')"/>
|
||||
<input type="button" name="send_content" value="{sprintf(lang("Flag this %s"),$params.type)}" class="btn btn-primary" onclick="_cb.flag_objectNew('flag_form','{$params.id}','{$params.type}')"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue