Ignore:
Timestamp:
Sep 18, 2014, 3:53:51 PM (10 years ago)
Author:
mistic100
Message:

remove "safe mode" checkbox, now fully automatic

Location:
extensions/gvideo/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/admin/add.php

    r28268 r29627  
    1818      $page['errors'][] = l10n('Please fill the video URL');
    1919    }
    20     else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
     20    else if ( ($video = parse_video_url($_POST['url'], $safe_mode)) === false )
    2121    {
    22       if (isset($_POST['safe_mode']))
     22      $page['errors'][] = l10n('an error happened');
     23    }
     24    else
     25    {
     26      if ($safe_mode === true)
    2327      {
    24         $page['errors'][] = l10n('an error happened');
     28        $page['warnings'][] = l10n('Unable to contact host server');
     29        $page['warnings'][] = l10n('Video data like description and thumbnail might be missing');
    2530      }
    26       else
    27       {
    28         $page['errors'][] = l10n('Unable to contact host server');
    29         $page['errors'][] = l10n('Try in safe-mode');
    30       }
    31       $_POST['safe_mode'] = true;
    32     }
    33 
    34     if (count($page['errors']) == 0)
    35     {
     31     
    3632      if ($_POST['size_common'] == 'true')
    3733      {
  • extensions/gvideo/admin/photo.php

    r28268 r29627  
    5656    else if ($gvideo['url']!=$_POST['url'])
    5757    {
    58       if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
    59       {
    60         if (isset($_POST['safe_mode']))
    61         {
    62           $page['errors'][] = l10n('an error happened');
    63         }
    64         else
    65         {
    66           $page['errors'][] = l10n('Unable to contact host server');
    67           $page['errors'][] = l10n('Try in safe-mode');
    68         }
     58      if ( ($video = parse_video_url($_POST['url'], $safe_mode)) === false )
     59      {
     60        $page['errors'][] = l10n('an error happened');
    6961      }
    7062    }
    7163    else
    7264    {
     65      $safe_mode = false;
    7366      $video = $gvideo;
    7467    }
     
    7669    if (count($page['errors']) == 0)
    7770    {
    78 
     71      if ($safe_mode === true)
     72      {
     73        $page['warnings'][] = l10n('Unable to contact host server');
     74        $page['warnings'][] = l10n('Video data like description and thumbnail might be missing');
     75      }
     76     
    7977      if ($gvideo['url'] != $video['url'])
    8078      {
  • extensions/gvideo/admin/template/add.tpl

    r28268 r29627  
    124124<p style="text-align:left;">
    125125  <input type="submit" name="add_video" value="{'Add'|translate}">
    126  
    127   <span class="embed-hide provider-show">
    128     <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|translate}</label>
    129     <a class="icon-info-circled-1 showInfo" title="{'In safe-mode, the plugin does\'t try to contact the video host, usefull on some websites where remote connections are blocked.'|translate|escape:html}"></a>
    130   </span>
    131126</p>
    132127
  • extensions/gvideo/admin/template/photo.tpl

    r28268 r29627  
    108108   
    109109    <p style="margin:0;">
    110       {if $GVIDEO.type != 'embed'}<label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|translate}</label>
    111       <br>{/if}
    112110      <input class="submit" type="submit" value="{'Save Settings'|translate}" name="save_properties">
    113111    </p>
Note: See TracChangeset for help on using the changeset viewer.