Example #1
0
/**
 * get owner's videos
 * 
 * @param string  $hook
 * @param string  $type
 * @param array   $return
 * @param array   $params
 * 
 * @return \ElggMenuItem
 * 
 * @version 5.0
 */
function izap_owner_block_izap_videos($hook, $type, $return, $params)
{
    if (elgg_instanceof($params['entity'], 'group')) {
        $url = izap_set_href(array('context' => GLOBAL_IZAP_VIDEOS_PAGEHANDLER, 'action' => 'all', 'full_url' => FALSE));
        $item = new ElggMenuItem(GLOBAL_IZAP_VIDEOS_PAGEHANDLER, elgg_echo('izap-videos:videos_' . $params['entity']->getType()), $url);
        $return[] = $item;
    }
    return $return;
}
Example #2
0
/**
 * Check YouTube response
 * 
 * @version 5.0
 */
function izap_video_get_page_content_youtube_next()
{
    $is_status = get_input('status') == 200 ? true : false;
    if (!$is_status) {
        // redirect the user from where he was trying to upload the video.
        register_error("We did not get expected response from YouTube. You might need to provide appropriate youtube category.");
        forward(izap_set_href(array('context' => GLOBAL_IZAP_VIDEOS_PAGEHANDLER, 'action' => 'add', 'page_owner' => elgg_instanceof(elgg_get_page_owner_entity(), 'group') ? elgg_get_page_owner_entity()->username : elgg_get_logged_in_user_entity()->username, 'vars' => array('tab' => ($onserver = izap_is_onserver_enabled_izap_videos()) ? $onserver == 'yes' ? 'onserver' : 'youtube' : 'offserver'))));
        exit;
    }
    $id = get_input('id');
    $pass = '******';
    forward(elgg_add_action_tokens_to_url(elgg_get_site_url() . GLOBAL_IZAP_VIDEOS_PAGEHANDLER . '/youtube_response?id=' . $id . '&p=' . $pass));
    exit;
}
Example #3
0
 *    This file is part of izap-videos plugin for Elgg.
 *
 *    izap-videos for Elgg is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    izap-videos for Elgg is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with izap-videos for Elgg.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Save YouTube videos
 * 
 * @version 5.0
 */
$youtube_data = array('title' => $this->title, 'description' => $this->description, 'youtube_cats' => $this->youtube_cats, 'tags' => $this->tags, 'container_guid' => $this->container_guid, 'access_id' => $this->access_id, 'tags' => $this->tags);
$_SESSION['youtube_attributes'] = $youtube_data;
$video = IzapGYoutube::getAuthSubHttpClient(get_input('token', false));
//get youtube api authorization via users application access.
if (!$video instanceof IzapGYoutube) {
    forward($video);
} else {
    // if we already have access token for youtube. than redirect user directly
    // on upload page.
    forward(izap_set_href(array('action' => 'upload', 'context' => GLOBAL_IZAP_VIDEOS_PAGEHANDLER)));
}
Example #4
0
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with izap-videos for Elgg.  If not, see <http://www.gnu.org/licenses/>.
 */
$group = elgg_get_page_owner_entity();
if ($group->{GLOBAL_IZAP_VIDEOS_PAGEHANDLER . '_enable'} == "no") {
    return true;
}
$all_link = elgg_view('output/url', array('href' => izap_set_href(array('context' => GLOBAL_IZAP_VIDEOS_PAGEHANDLER, 'action' => 'all')), 'text' => elgg_echo('link:view:all')));
elgg_push_context('izap_mini_list');
$options = array('container_guid' => elgg_get_page_owner_guid(), 'limit' => 6, 'full_view' => false, 'pagination' => false);
$content = elgg_list_entities(izap_defalut_get_videos_options($options));
elgg_pop_context();
if (!$content) {
    $content = '<p>' . elgg_echo('izap-videos:none') . '</p>';
}
$url = GLOBAL_IZAP_VIDEOS_PAGEHANDLER . '/add/';
if (izap_is_onserver_enabled_izap_videos() == 'yes') {
    $_tab = 'onserver';
} elseif (izap_is_onserver_enabled_izap_videos() == 'youtube') {
    $_tab = 'youtube';
} elseif (izap_is_offserver_enabled_izap_videos() == 'yes') {
    $_tab = 'offserver';
} else {
    $_tab = 'onserver';
}
$new_link = elgg_view('output/url', array('href' => izap_set_href(array('context' => GLOBAL_IZAP_VIDEOS_PAGEHANDLER, 'action' => 'add', 'vars' => array('tab' => $_tab))), 'text' => elgg_echo('izap_videos:add')));
echo elgg_view('groups/profile/module', array('title' => elgg_echo('izap-videos:videos_group'), 'content' => $content, 'all_link' => $all_link, 'add_link' => $new_link));