Ejemplo n.º 1
0
 public function gallery($value = null)
 {
     $attachments = array();
     if (is_array($value)) {
         foreach ($value as $gallery) {
             $gallery = new WT_Gallery($gallery["attachment_type_id"]);
             $gallery->retrieve();
             $attachments = array_merge($attachments, $gallery->get_attachments(array("thumbnail", "large")));
         }
     }
     return $attachments;
 }
Ejemplo n.º 2
0
function gallery_rows($rows)
{
    global $wpdb;
    if (!$rows) {
        ?>
		<tr class="empty">
			<td colspan="3"><p>No Galleries Found</p></td>
		</tr> 
	<?php 
    } else {
        ?>
	<?php 
        $gallery = new WT_Gallery();
        foreach ($rows as $row) {
            $gallery->data = $row;
            echo get_gallery_row_html($gallery->db_out($gallery->data));
        }
    }
}
Ejemplo n.º 3
0
		});
		return false;
	});

	$("#add-tour").click(function(){
		openInsertTourDialog({},function(r){
			$("#event_tour_name").val(r.result.tour_name).focus();
		});
		return false;
	});
	
	
	<?php 
$galleries_array = array();
foreach (wt_galleries() as $gallery) {
    $go = new WT_Gallery();
    $go->db_out($gallery);
    array_push($galleries_array, array("id" => $gallery["gallery_id"], "name" => $gallery["gallery_name"]));
}
?>

	function loadEvent(id){
		var id = id || "";
		$(this).wordtourform("ajax",{action:"get_event",event_id:id},function(r){
			if($.isArray(r)) {
				openAlertDialog("Error Loading Event","Event doesn't exist in the system",function(){
					window.location = $CONSTANT.PAGE_EVENTS;
					$("#wordtour-button-save").toolbarbutton("disable");
					$("#wordtour-button-trash").toolbarbutton("disable");
					$("#wordtour-button-publish").toolbarbutton("disable");
					$("#wordtour-button-twitter").toolbarbutton("disable");
Ejemplo n.º 4
0
function wordtour_gallery_checklist()
{
    foreach (wt_galleries() as $gallery) {
        $go = new WT_Gallery();
        $go->db_out($gallery);
        echo "<li><input type='text' value='{$gallery['gallery_id']}'>{$gallery['gallery_name']}</li>";
    }
}
Ejemplo n.º 5
0
        }
        echo json_encode($gallery->db_out(null, 0));
        break;
    case "insert_gallery":
        $gallery = new WT_Gallery();
        $gallery->insert($_POST);
        $gallery->db_response("json");
        break;
    case "update_gallery":
        $gallery = new WT_Gallery($_POST["gallery_id"]);
        $gallery->update($_POST);
        $gallery->db_response("json");
        break;
    case "update_gallery-from-event":
        $gallery = new WT_Gallery($_POST["gallery_id"]);
        $gallery->update($_POST);
        return $gallery->data["gallery_name"];
        break;
    case "delete_gallery":
        $gallery = new WT_Gallery($_POST["gallery_id"]);
        $gallery->delete($_POST["_nonce"]);
        $gallery->db_response("json");
        break;
    case "delete_all_galleries":
        if ($_POST["id"]) {
            $gallery = new WT_Gallery();
            $gallery->delete_all(json_decode(stripslashes($_POST["id"])), $_POST["_nonce"]);
            $gallery->db_response("json");
        }
        break;
}