Exemplo n.º 1
0
 /**
  * Method to edit Dailymotion video by media Id
  */
 public function editDailyMotionRecords()
 {
     $media_id = $_POST['mediaId'] ? $_POST['mediaId'] : null;
     if (!empty($media_id)) {
         $dailymotion = new DailymotionOwnMethod();
         $videoInfo = $dailymotion->getDailyMotionVideoDetail($media_id);
         $chennelslist = $dailymotion->getDailymotionChannelList();
         $mediaImageURL = !empty($videoInfo['thumbnail_url']) ? $videoInfo['thumbnail_url'] : DAILYMOTION_URL . '/img/no_files_found.jpg';
         $description = !empty($videoInfo['description']) ? $videoInfo['description'] : '';
         $tags = !empty($videoInfo['tags']) ? implode(', ', $videoInfo['tags']) : '';
         $Channels = !empty($videoInfo['channel']) ? $videoInfo['channel'] : '';
         $curpage = !empty($_POST['curpage']) ? $_POST['curpage'] : 'notfound';
         $str = '';
         $str .= '<script type="text/javascript" src="' . DAILYMOTION_URL . '/js/ajax-upload_pattern.js"></script>';
         $str .= '<div class="dmc-edit-container dm-common">';
         $str .= '<form enctype="multipart/form-data" action="" id="dm_update_form" method="post">';
         $str .= '<input type="hidden" name="id" size="50" value="' . $videoInfo['id'] . '" />';
         $str .= '<input type="hidden" id="curpage" name="curpage" value="' . $curpage . '" />';
         $str .= '<input type="hidden" id="status_publish" name="data[published]" value="true" />';
         $str .= '<div class="logo">
                     <h2>Edit Video</h2>
                     <span class="logo"></span>
                 </div>';
         $str .= '<div class="title-wrap">
                     <label><span class="required">*</span>Video Title:</label>
                     <input type="text" name="data[title]" id="video-title" value="' . $videoInfo['title'] . '" />
                 </div>';
         $str .= '<div class="desc-wrap">
                     <label>Video Description:</label>
                     <textarea  name="data[description]" id="video-title">' . $description . '</textarea>
                  </div>';
         $str .= '<div class="channel-wrap">
                  <label><span class="required">*</span>Channel: <span class="qus_mark tooltip"><span><img class="callout" src="' . DAILYMOTION_URL . '/img/callout.gif" />Dailymotion Publisher allows you to earn advertising revenue when sharing Dailymotion videos on your site.</span></span></label>
                  <select type="text" id="channel" name="data[channel]">';
         $str .= '<option value="">Please select</option>';
         if (isset($chennelslist) && !empty($chennelslist)) {
             foreach ($chennelslist as $ck => $cv) {
                 isset($Channels) && $Channels == $ck ? $selected = 'selected="selected"' : ($selected = '');
                 $str .= '<option value="' . $ck . '" ' . $selected . '>' . $cv . '</option>';
             }
         }
         $str .= '</select></div>';
         $change = '';
         if (isset($videoInfo['type']) && $videoInfo['type'] == 'official') {
             $change = '<a id="browse_file" href="#">Change Thumbnail</a>
                  <input type="hidden" id="attach_id" name="at_id" value="" />
                  <input type="hidden" id="attach_url" name="data[thumbnail_url]" value="" />';
         }
         $str .= '<div class="thumb-wrap">
                  <label>Thumbnail:</label>
                  <div class="video-thumb">
                     <img class="edit-video-thumbnail" src="' . $mediaImageURL . '" alt="" width="150" height="150"/>
                  </div>
                  <div class="thumb-right">
                     ' . $change . '
                     <div class="msg">
                        <p>Minimum 150 px wide</p>
                        <p>Recommended aspect ratio: 4:3 or 16:9</p>
                     </div>
                  </div>
               </div>';
         $str .= '<div class="tags-wrap">
                     <label>Tag(s):</label>
                     <input type="text" class="tags" name="data[tags]" maxlength="250" size="50" id="video-tags" value="' . $tags . '" />
                 </div>';
         $checked_private = isset($videoInfo['private']) && $videoInfo['private'] == 1 ? 'checked="checked"' : '';
         $checked_public = isset($videoInfo['private']) && $videoInfo['private'] == 1 ? '' : 'checked="checked"';
         $class_private = isset($videoInfo['private']) && $videoInfo['private'] == 1 ? 'blur' : '';
         $class_public = isset($videoInfo['private']) && $videoInfo['private'] == 1 ? '' : 'blur';
         $str .= '<div class="visibility-wrap visibility_private ' . $class_public . '">
                     <label>Visibility:</label>
                     <label><input id="dm-video-private" type="radio" name="dm_video_status" value="1" name="data[private]" ' . $checked_private . '>Private
                     <div class="cls_visibility">
                        <p>This video is private and accessable through private link below</p>
                        <span>Private URL</soan>
                     </div></label>
               </div>';
         $str .= '<div class="visibility-wrap visibility_public ' . $class_private . '">
                     <label><input id="dm-video-public" type="radio" name="dm_video_status" value="0" name="data[private]" ' . $checked_public . '>Public
                     <div class="cls_visibility">
                        <p>This video is public and can be seen by anyone on Dailymotion.com.</p>
                        <span>Private URL</span>
                     </div></label>
               </div>';
         $str .= '<div class="alert-msg" id="dm-message"></div>';
         $str .= '<div class="footer-row">
                             <div class="delete">
                                <a href="javascript:void(0);" class="dmc-trash-trigger">Delete this video</a>
                                <div class="confirm-box">
                                   <div class="head"><span class="arrow"></span>Delete this video?</div>
                                   <div class="message">This video will be deleted from your Dailymotion.com account.</div>
                                   <a class="dmc-keep-it" href="javascript:void(0);">No, keep it</a>
                                   <a rel="' . $media_id . '" class="delete-it" href="javascript:void(0);">Yes, delete</a>
                                </div>
                             </div>
                             <div class="save">
                                <a class="save_new_data" onclick="return getDailymotionupdatedvalues();" href="javascript:void(0);">Save</a>
                             </div>
                          </div>
                    </div>';
         $str .= '</form>';
         $str .= '</div>';
         echo $str;
         die;
     }
 }
Exemplo n.º 2
0
 /** 
  * Get the settings option array and print one of its values
  */
 public function dm_channel_callback()
 {
     $chennels = new DailymotionOwnMethod();
     $chennelslist = $chennels->getDailymotionChannelList();
     $output = '<select type="text" id="dm_channel" name="publish_id_option_name[dm_channel]">';
     $output .= '<option value="">Please select</option>';
     if (isset($chennelslist) && !empty($chennelslist)) {
         foreach ($chennelslist as $ck => $cv) {
             isset($this->options['dm_channel']) && $this->options['dm_channel'] == $ck ? $selected = 'selected="selected"' : ($selected = '');
             $output .= '<option value="' . $ck . '" ' . $selected . '>' . $cv . '</option>';
         }
     }
     $output .= '</select><span class="qus_mark tooltip"><span><img class="callout" src="' . DAILYMOTION_URL . '/img/callout.gif" />Dailymotion Publisher allows you to earn advertising revenue when sharing Dailymotion videos on your site.</span></span>';
     print $output;
 }