[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the Bookmarket plugin. 4 * 5 * This file is part of the b2evolution project - {@link http://b2evolution.net/} 6 * 7 * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/} 8 * 9 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL) 10 * 11 * @package plugins 12 * 13 * {@internal Below is a list of authors who have contributed to design/coding of this file: }} 14 * @author fplanque: Francois PLANQUE - {@link http://fplanque.net/} 15 * @author cafelog (team) - http://cafelog.com/ 16 * 17 * @version $Id: _bookmarklet.plugin.php,v 1.19 2007/04/26 00:11:04 fplanque Exp $ 18 */ 19 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 20 21 22 /** 23 * Sidebar plugin 24 * 25 * Adds a tool allowing blogging from the sidebar 26 */ 27 class bookmarklet_plugin extends Plugin 28 { 29 var $name = 'Bookmarklet'; 30 var $code = 'cafeBkmk'; 31 var $priority = 94; 32 var $version = '1.9-dev'; 33 var $author = 'Cafelog team'; 34 var $number_of_installs = 1; 35 36 37 /** 38 * Init 39 */ 40 function PluginInit( & $params ) 41 { 42 $this->short_desc = T_('Allow bookmarklet blogging.'); 43 $this->long_desc = T_('Adds a tool allowing blogging through a bookmarklet.'); 44 } 45 46 47 /** 48 * We are displaying the tool menu. 49 * 50 * @todo Do not create links/javascript code based on browser detection! But: test for functionality! 51 * 52 * @param array Associative array of parameters 53 * @return boolean did we display a tool menu block? 54 */ 55 function AdminToolPayload( $params ) 56 { 57 global $Hit, $admin_url; 58 59 if( $Hit->is_NS4 || $Hit->is_gecko ) 60 { 61 ?> 62 <p><?php echo T_('Add this link to your Favorites/Bookmarks:') ?><br /> 63 <a href="javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('<?php echo $admin_url ?>?ctrl=items&action=new&mode=bookmarklet&content='+escape(Q)+'&post_url='+escape(location.href)+'&post_title='+escape(document.title),'b2evobookmarklet','scrollbars=yes,resizable=yes,width=750,height=550,left=25,top=15,status=yes'));"><?php echo T_('b2evo bookmarklet') ?></a></p> 64 <?php 65 return true; 66 } 67 elseif( $Hit->is_winIE ) 68 { 69 ?> 70 <p><?php echo T_('Add this link to your Favorites/Bookmarks:') ?><br /> 71 <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo $admin_url ?>?ctrl=items&action=new&mode=bookmarklet&content='+escape(Q)+'&post_url='+escape(location.href)+'&post_title='+escape(document.title),'b2evobookmarklet','scrollbars=yes,resizable=yes,width=750,height=550,left=25,top=15,status=yes'));btw.focus();"><?php echo T_('b2evo bookmarklet') ?></a> 72 </p> 73 <?php 74 return true; 75 } 76 elseif( $Hit->is_opera ) 77 { 78 ?> 79 <p><?php echo T_('Add this link to your Favorites/Bookmarks:') ?><br /> 80 <a href="javascript:void(window.open('<?php echo $admin_url ?>?ctrl=items&action=new&mode=bookmarklet&post_url='+escape(location.href)+'&post_title='+escape(document.title),'b2evobookmarklet','scrollbars=yes,resizable=yes,width=750,height=550,left=25,top=15,status=yes'));"><?php echo T_('b2evo bookmarklet') ?></a></p> 81 <?php 82 return true; 83 } 84 elseif( $Hit->is_macIE ) 85 { 86 ?> 87 <p><?php echo T_('Add this link to your Favorites/Bookmarks:') ?><br /> 88 <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $admin_url ?>?ctrl=items&action=new&mode=bookmarklet&content='+escape(document.getSelection())+'&post_url='+escape(location.href)+'&post_title='+escape(document.title),'b2evobookmarklet','scrollbars=yes,resizable=yes,width=750,height=550,left=25,top=15,status=yes'));btw.focus();"><?php echo T_('b2evo bookmarklet') ?></a></p> 89 <?php 90 return true; 91 } 92 93 return false; 94 } 95 } 96 97 98 /* 99 * $Log: _bookmarklet.plugin.php,v $ 100 * Revision 1.19 2007/04/26 00:11:04 fplanque 101 * (c) 2007 102 * 103 * Revision 1.18 2007/04/20 02:53:13 fplanque 104 * limited number of installs 105 * 106 * Revision 1.17 2006/12/12 02:53:57 fplanque 107 * Activated new item/comments controllers + new editing navigation 108 * Some things are unfinished yet. Other things may need more testing. 109 * 110 * Revision 1.16 2006/12/06 23:25:32 blueyed 111 * Fixed bookmarklet plugins (props Danny); removed unneeded bookmarklet handling in core 112 * 113 * Revision 1.15.2.2 2006/11/04 19:55:11 fplanque 114 * Reinjected old Log blocks. Removing them from CVS was a bad idea -- especially since Daniel has decided branch 1.9 was his HEAD... 115 * 116 * Revision 1.15 2006/07/10 20:19:30 blueyed 117 * Fixed PluginInit behaviour. It now gets called on both installed and non-installed Plugins, but with the "is_installed" param appropriately set. 118 * 119 * Revision 1.14 2006/07/07 21:26:49 blueyed 120 * Bumped to 1.9-dev 121 * 122 * Revision 1.13 2006/07/06 19:56:29 fplanque 123 * no message 124 * 125 * Revision 1.12 2006/06/16 21:30:57 fplanque 126 * Started clean numbering of plugin versions (feel free do add dots...) 127 * 128 * Revision 1.11 2006/05/30 19:39:55 fplanque 129 * plugin cleanup 130 * 131 * Revision 1.10 2006/05/19 15:59:52 blueyed 132 * Fixed bookmarklet plugin. Thanks to personman for pointing it out. 133 * 134 * Revision 1.9 2006/04/11 21:22:26 fplanque 135 * partial cleanup 136 * 137 */ 138 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 23:58:50 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |