Ejemplo n.º 1
0
    function metaWeblog_getCategories($args)
    {
        global $DB;
        global $session;
        $out = array();
        list($website_id, $username, $password) = $args;
        // check auth
        if (metaWeblog_userAllowed($username, $password, $website_id)) {
            // get all public categories
            $DB->query('
				SELECT id
				  FROM nv_structure
				 WHERE website = ' . protect($website_id) . '
				   AND permission < 2
				ORDER BY parent ASC, position  ASC
			');
            $categories = $DB->result();
            $website = new website();
            $website->load($website_id);
            foreach ($categories as $category) {
                $cat = new structure();
                $cat->load($category->id);
                $url = '';
                if ($cat->paths[$session['lang']]) {
                    $url = $website->absolute_path(true) . $cat->paths[$session['lang']];
                }
                $out[] = array("categoryId" => $cat->id, "parentId" => $cat->parent, "categoryName" => $cat->dictionary[$session['lang']]['title'], "categoryDescription" => $cat->template, "htmlUrl" => $url, "rssUrl" => "", "title" => $cat->dictionary[$session['lang']]['title'], "description" => $cat->template);
            }
        } else {
            $out = new IXR_Error(401, "User not allowed.");
        }
        return $out;
    }
Ejemplo n.º 2
0
    public function navigate_title()
    {
        global $website;
        global $DB;
        $DB->query('SELECT * FROM nv_websites WHERE 1 = 1 ORDER BY name ASC');
        $websites = $DB->result();
        $extruder = '';
        $main_title = '';
        $main_url = '';
        foreach ($websites as $web) {
            $style = ' display: none; ';
            $ws = new website();
            $ws->load_from_resultset(array($web));
            if ($ws->id == $website->id) {
                $style = ' display: block; ';
            }
            $url = $ws->absolute_path(true);
            if ($ws->id == $website->id) {
                $main_title = $ws->name;
                $main_url = $url;
                $main_config_url = '?fid=websites&act=2&id=' . $ws->id;
            } else {
                $extruder .= '<div class="voice {}" style=" display: none; ">
								<a href="' . $url . '" target="_blank"><img align="absmiddle" src="' . NAVIGATE_URL . '/img/icons/silk/house_link.png" width="16px" height="16px" /></a>
								<a class="label" href="?act=0&wid=' . $ws->id . '">' . $ws->name . '</a>								
							  </div>';
            }
        }
        $extruder .= '<div style="clear: both;"></div>';
        if (!empty($main_title)) {
            // mb extruder
            $this->add_content('
			  <div id="navigate-website-selector-top" class="{title:\'' . str_replace("'", "\\'", htmlspecialchars($main_title)) . '\'}">
				' . $extruder . '
			  </div>
			  <a id="navigate-website-main-link" href="' . $main_url . '" target="_blank" style=" margin-right: 5px; display: none; "><img align="absmiddle" src="' . NAVIGATE_URL . '/img/icons/silk/house_link.png" width="16px" height="16px" /></a>
			');
            $this->add_script('
				$("#navigate-website-selector-top").buildMbExtruder(
				{
					positionFixed:true,
					width:400,
					sensibility:800,
					position:"top", // left, right, bottom
					extruderOpacity: 1, // was 0.9 for better integration (FF 8.0 problems)
					flapDim:100,
					textOrientation:"bt", // or "tb" (top-bottom or bottom-top)
					onExtOpen:function() {},
					onExtContentLoad:function(){},
					onExtClose:function(){},
					hidePanelsOnClose:true,
					autoCloseTime:3000, // 0=never
					slideTimer:300
				});
			');
            $this->add_script('
			    $("#navigate-website-selector-top").find(".flapLabel").css("padding-left", "21px");
			    $("#navigate-website-selector-top div.flap").addClass("ui-corner-bottom");
			    $("#navigate-website-selector-top div.flap").css("opacity", 1);
			    $("#navigate-website-selector-top").on("click", ".silk-sprite", function(e)
			    {
			        setTimeout(
			            function()
			            {
			                $("#navigate-website-selector-top").closeMbExtruder();
		                }, 
		                1000
	                );
			    });
			');
        }
    }