X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FDirectionDetector%2FDirectionDetectorPlugin.php;h=289196b4a9627a6d60e5176895b2bfae73a79ae7;hb=4f454abf7bc5d4a0e30a71e5ce5f73e71d40fff2;hp=ac6b43c1f312f9def96388abae7ff3c0c882b4bd;hpb=10f6e14134cd00d018127d99f90ada5c52805e39;p=quix0rs-gnu-social.git diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index ac6b43c1f3..289196b4a9 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -1,5 +1,4 @@ element('style', array('type' => 'text/css'), 'span.rtl {display:block;direction:rtl;text-align:right;float:right;} .notice .author {float:left}'); - } - /** * is passed string a rtl content or not * @@ -82,6 +72,9 @@ class DirectionDetectorPlugin extends Plugin { * @return boolean */ public static function startsWithRTLCharacter($str){ + if (strlen($str) < 1) { + return false; + } if( is_array($cc = self::utf8ToUnicode(mb_substr($str, 0, 1, 'utf-8'))) ) $cc = $cc[0]; else @@ -125,9 +118,9 @@ class DirectionDetectorPlugin extends Plugin { * * @param Action $action */ - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { - $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js'); + $action->script($this->path('jquery.DirectionDetector.js')); } } @@ -251,11 +244,15 @@ class DirectionDetectorPlugin extends Plugin { /** * plugin details */ - function onPluginVersion(&$versions){ + function onPluginVersion(array &$versions){ + $url = 'http://status.net/wiki/Plugin:DirectionDetector'; + $versions[] = array( 'name' => 'Direction detector', 'version' => DIRECTIONDETECTORPLUGIN_VERSION, 'author' => 'Behrooz Shabani', + 'homepage' => $url, + // TRANS: Plugin description. 'rawdescription' => _m('Shows notices with right-to-left content in correct direction.') ); return true;