]> git.mxchange.org Git - friendica.git/commitdiff
Add 'jot_tool' hook, plugins can add tool icons.
authorFabio Comuni <fabrix.xm@gmail.com>
Wed, 26 Jan 2011 15:17:28 +0000 (16:17 +0100)
committerFabio Comuni <fabrix.xm@gmail.com>
Wed, 26 Jan 2011 15:17:28 +0000 (16:17 +0100)
addon/README
mod/network.php
mod/profile.php
view/en/jot.tpl
view/fr/jot.tpl
view/it/jot.tpl
view/theme/default/style.css
view/theme/duepuntozero/style.css

index 2e4ed602908512697f011b4feed90653aaf0ae48..fb1c6340a50cf1d4ba1bc3ac0067575840e64a0e 100644 (file)
@@ -156,7 +156,8 @@ Current hooks:
 'page_end' - called after HTML content functions have completed
     $b is (string) HTML of content div
 
-
+'jot_plugin' - add tools to jot toolbar
+  $b is (string) HTML for tool icon
 
 
 *** = subject to change
index f9badda78bada413e513d88920515e1bba751c77..083912f869ea900497bf8585bed5acf87dc1c40d 100644 (file)
@@ -79,6 +79,9 @@ function network_content(&$a, $update = 0) {
 
                $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
 
+    $jotplugins = "";
+    call_hooks('jot_tool', $jotplugins);
+
                $o .= replace_macros($tpl,array(
                        '$return_path' => $a->cmd,
                        '$baseurl' => $a->get_baseurl(),
@@ -87,7 +90,8 @@ function network_content(&$a, $update = 0) {
                        '$lockstate' => $lockstate,
                        '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
                        '$bang' => (($group) ? '!' : ''),
-                       '$profile_uid' => $_SESSION['uid']
+                       '$profile_uid' => $_SESSION['uid'],
+                       '$jotplugins' => $jotplugins
                ));
 
 
index 505edf5ced6be421a88b1d649066442d884d1a9c..c84b493c5039ac6bf94e8f73ba388a38c44e845a 100644 (file)
@@ -134,6 +134,10 @@ function profile_content(&$a, $update = 0) {
                                $lockstate = 'lock';
                        else
                                $lockstate = 'unlock';
+       
+      $jotplugins = "";
+      call_hooks('jot_tool', $jotplugins); 
+        
                        $o .= replace_macros($tpl,array(
                                '$baseurl' => $a->get_baseurl(),
                                '$defloc' => (($is_owner) ? $a->user['default-location'] : ''),
@@ -142,7 +146,8 @@ function profile_content(&$a, $update = 0) {
                                '$lockstate' => $lockstate,
                                '$bang' => '',
                                '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
-                               '$profile_uid' => $a->profile['profile_uid']
+                               '$profile_uid' => $a->profile['profile_uid'],
+                               '$jotplugins' => $jotplugins
                        ));
                }
 
index 6590cace8f086dca413404247bbe0ce1664006d4..de88fb84f7b371386b0fed5ef9ae02881bab690b 100644 (file)
 
                <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
 
+<div id="profile-jot-plugin-wrapper" >
+  $jotplugins
+</div>
+<div id="profile-jot-plugin-end"></div>
+
 <div id="profile-jot-submit-wrapper" >
 <input type="submit" id="profile-jot-submit" name="submit" value="Share" />
        <div id="profile-upload-wrapper" style="display: $visitor;" >
index 6590cace8f086dca413404247bbe0ce1664006d4..9a5c581531d970479a4b0a62c44de2caf122eace 100644 (file)
 
                <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
 
+<div id="profile-jot-plugin-wrapper" >
+  $jotplugins
+</div>
+<div id="profile-jot-plugin-end"></div>
+
+
 <div id="profile-jot-submit-wrapper" >
 <input type="submit" id="profile-jot-submit" name="submit" value="Share" />
        <div id="profile-upload-wrapper" style="display: $visitor;" >
index 5aaf9b9232976335160229c43955ff5105ebb43f..b0c90ddf5dd016c594fc84f0d6c17c66a6084c38 100644 (file)
 
                <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
 
+<div id="profile-jot-plugin-wrapper" >
+  $jotplugins
+</div>
+<div id="profile-jot-plugin-end"></div>
+
 <div id="profile-jot-submit-wrapper" >
 <input type="submit" id="profile-jot-submit" name="submit" value="Condividi" />
        <div id="profile-upload-wrapper" style="display: $visitor;" >
@@ -40,6 +45,8 @@
        <div id="profile-jot-acl-wrapper" style="display: none;" >$acl</div>
 </div>
 
+
+
 <div id="profile-jot-end"></div>
 </form>
 </div>
index fcc9c94a880c84eb4244d6793a72684781db6cd3..6e643d4fe2eac46fef4aa17ffc472cab5161b84c 100644 (file)
@@ -1034,7 +1034,7 @@ input#dfrn-url {
        margin-left: 110px;
        margin-top: 10px;
 }
-
+#profile-jot-plugin-wrapper,
 #profile-jot-submit-wrapper {
        margin-top: 15px;
 }
@@ -1078,7 +1078,9 @@ input#dfrn-url {
 #profile-jot-perms-end {
        clear: both;
 }
-
+#profile-jot-plugin-end {
+  clear:both;
+}
 #profile-jot-end {
        clear: both;
        margin-bottom: 30px;
@@ -2000,3 +2002,10 @@ a.mail-list-link {
        margin-bottom: 15px;
 }
 
+.tool-wrapper {
+  float: left;
+  margin-left: 5px;
+}
+.tool-link {
+  cursor: pointer;
+}
index 1a415db4503b52301ea742ae42c411d2c9b3b585..76a37e7c43e17de7beb81fd52511a3dcc3ce41f1 100644 (file)
@@ -907,6 +907,7 @@ input#dfrn-url {
        margin: 10px 0px 10px 110px;
 }
 
+#profile-jot-plugin-wrapper,
 #profile-jot-submit-wrapper {
        margin-top: 15px;
 }
@@ -952,6 +953,9 @@ input#dfrn-url {
        height: 30px;
 }
 
+#profile-jot-plugin-end{
+  clear: both;
+}
 #profile-jot-end {
        /*clear: both;*/
        margin-bottom: 30px;
@@ -1885,3 +1889,11 @@ a.mail-list-link {
        margin-bottom: 15px;
 }
 
+
+.tool-wrapper {
+  float: left;
+  margin-left: 5px;
+}
+.tool-link {
+  cursor: pointer;
+}