From ce4a1dcc193d3124fc51c4942137621d3d806a19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 10 Sep 2013 14:41:58 +0200 Subject: [PATCH] changes to add url directly from poche --- inc/poche/Poche.class.php | 7 +------ index.php | 7 ++++--- tpl/_menu.twig | 12 ++---------- tpl/config.twig | 15 ++++++++------- tpl/css/style.css | 3 ++- tpl/layout.twig | 1 - 6 files changed, 17 insertions(+), 28 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 4fe938fb..5030c9aa 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -182,7 +182,7 @@ class Poche } if (!$import) { - Tools::redirect(); + Tools::redirect('?view=home'); } break; case 'delete': @@ -558,9 +558,4 @@ class Poche } return $version; } - - function convertURLToBase64($plainurl){ - $convertedURL = base64_encode($plainurl); - $this->action('add', new Url($convertedURL)); - } } \ No newline at end of file diff --git a/index.php b/index.php index e81a9247..7b775c41 100644 --- a/index.php +++ b/index.php @@ -43,9 +43,10 @@ elseif (isset($_GET['import'])) { elseif (isset($_GET['export'])) { $poche->export(); } - -if (isset($_GET['plainurl'])){ - $poche->convertURLToBase64($_GET['plainurl']);} +elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { + $plain_url = new Url(base64_encode($_GET['plainurl'])); + $poche->action('add', $plain_url); +} # vars to send to templates $tpl_vars = array( diff --git a/tpl/_menu.twig b/tpl/_menu.twig index b39ce35f..523d63cc 100644 --- a/tpl/_menu.twig +++ b/tpl/_menu.twig @@ -3,13 +3,5 @@
  • {% trans "favorites" %}
  • {% trans "archive" %}
  • {% trans "config" %}
  • -
  • {% trans "addlink" %}
  • -
  • {% trans "logout" %}
  • - -
    -
    -
    - - -
    -
    \ No newline at end of file +
  • {% trans "logout" %}
  • + \ No newline at end of file diff --git a/tpl/config.twig b/tpl/config.twig index c838c319..e24e58d4 100644 --- a/tpl/config.twig +++ b/tpl/config.twig @@ -2,13 +2,7 @@ {% block title %}{% trans "config" %}{% endblock %} {% block menu %} - +{% include '_menu.twig' %} {% endblock %} {% block content %}

    {% trans "Poching a link" %}

    @@ -17,6 +11,13 @@
  • firefox: download the extension
  • chrome: download the extension
  • android: download the application
  • +
  • +
    + + + +
    +
  • bookmarklet: drag & drop this link to your bookmarks bar {% trans "poche it!" %}
  • diff --git a/tpl/css/style.css b/tpl/css/style.css index 7d2c143f..d644814d 100644 --- a/tpl/css/style.css +++ b/tpl/css/style.css @@ -258,13 +258,14 @@ footer { font-size: 0.8em; } -#inputform{ +#inputform { display: none; text-align:center; max-width:300px; margin-left:auto; margin-right:auto; margin-top:5px; + padding-bottom: 5px; background-color: rgba(0, 0, 0, 0.9); opacity:0.8; color:white; diff --git a/tpl/layout.twig b/tpl/layout.twig index b2484019..07ca231c 100644 --- a/tpl/layout.twig +++ b/tpl/layout.twig @@ -12,7 +12,6 @@ {% block title %}{% endblock %} - poche {% include '_head.twig' %} - {% include '_bookmarklet.twig' %} -- 2.41.0