OSDN Git Service

Add tooltip for help icon
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 27 Feb 2009 15:29:33 +0000 (15:29 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 27 Feb 2009 15:29:33 +0000 (15:29 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@961 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/nucleus/libs/globalfunctions.php

index 37f2114..7530e72 100755 (executable)
@@ -871,7 +871,7 @@ function selector() {
 \r
                // get next and prev month links ...\r
                global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;\r
-               \r
+\r
                // sql queries for the timestamp of the first and the last published item\r
                $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime ASC";\r
                $first_timestamp=quickQuery ($query);\r
@@ -883,18 +883,18 @@ function selector() {
                if ($d != 0) {\r
                        $archivetype = _ARCHIVETYPE_DAY;\r
                        $t = mktime(0, 0, 0, $m, $d, $y);\r
-                       // one day has 24 * 60 * 60 = 86400 seconds                     \r
+                       // one day has 24 * 60 * 60 = 86400 seconds\r
                        $archiveprev = strftime('%Y-%m-%d', $t - 86400 );\r
-                       // check for published items                    \r
+                       // check for published items\r
                        if ($t > $first_timestamp) {\r
                                $archiveprevexists = true;\r
                        }\r
                        else {\r
                                $archiveprevexists = false;\r
                        }\r
-                       \r
+\r
                        // one day later\r
-                       $t += 86400; \r
+                       $t += 86400;\r
                        $archivenext = strftime('%Y-%m-%d', $t);\r
                        if ($t < $last_timestamp) {\r
                                $archivenextexists = true;\r
@@ -902,7 +902,7 @@ function selector() {
                        else {\r
                                $archivenextexists = false;\r
                        }\r
-                       \r
+\r
                } else {\r
                        $archivetype = _ARCHIVETYPE_MONTH;\r
                        $t = mktime(0, 0, 0, $m, 1, $y);\r
@@ -914,8 +914,8 @@ function selector() {
                        else {\r
                                $archiveprevexists = false;\r
                        }\r
-                       \r
-                       // timestamp for the next month                 \r
+\r
+                       // timestamp for the next month\r
                        $t = mktime(0, 0, 0, $m+1, 1, $y);\r
                        $archivenext = strftime('%Y-%m', $t);\r
                        if ($t < $last_timestamp) {\r
@@ -1204,7 +1204,7 @@ function help($id) {
 \r
 function helpHtml($id) {\r
        global $CONF;\r
-       return helplink($id) . '<img src="' . $CONF['AdminURL'] . 'documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" /></a>';\r
+       return helplink($id) . '<img src="' . $CONF['AdminURL'] . 'documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" title="' . _HELP_TT . '" /></a>';\r
 }\r
 \r
 function helplink($id) {\r
@@ -1628,67 +1628,67 @@ function checkVars($aVars) {
 }\r
 \r
 \r
-/** \r
+/**\r
  * Sanitize parameters such as $_GET and $_SERVER['REQUEST_URI'] etc.\r
- * to avoid XSS \r
+ * to avoid XSS\r
  */\r
 function sanitizeParams()\r
 {\r
        global $HTTP_SERVER_VARS;\r
-       \r
+\r
        $array = array();\r
        $str = '';\r
        $frontParam = '';\r
-       \r
+\r
        // REQUEST_URI of $HTTP_SERVER_VARS\r
        $str =& $HTTP_SERVER_VARS["REQUEST_URI"];\r
        serverStringToArray($str, $array, $frontParam);\r
        sanitizeArray($array);\r
        arrayToServerString($array, $frontParam, $str);\r
-       \r
+\r
        // QUERY_STRING of $HTTP_SERVER_VARS\r
        $str =& $HTTP_SERVER_VARS["QUERY_STRING"];\r
        serverStringToArray($str, $array, $frontParam);\r
        sanitizeArray($array);\r
        arrayToServerString($array, $frontParam, $str);\r
-       \r
+\r
        if (phpversion() >= '4.1.0') {\r
                // REQUEST_URI of $_SERVER\r
                $str =& $_SERVER["REQUEST_URI"];\r
                serverStringToArray($str, $array, $frontParam);\r
                sanitizeArray($array);\r
                arrayToServerString($array, $frontParam, $str);\r
-       \r
+\r
                // QUERY_STRING of $_SERVER\r
                $str =& $_SERVER["QUERY_STRING"];\r
                serverStringToArray($str, $array, $frontParam);\r
                sanitizeArray($array);\r
                arrayToServerString($array, $frontParam, $str);\r
        }\r
-       \r
+\r
        // $_GET\r
        convArrayForSanitizing($_GET, $array);\r
        sanitizeArray($array);\r
        revertArrayForSanitizing($array, $_GET);\r
-       \r
+\r
        // $_REQUEST (only GET param)\r
        convArrayForSanitizing($_REQUEST, $array);\r
        sanitizeArray($array);\r
        revertArrayForSanitizing($array, $_REQUEST);\r
 }\r
 \r
-/** \r
+/**\r
  * Check ticket when not checked in plugin's admin page\r
  * to avoid CSRF.\r
  * Also avoid the access to plugin/index.php by guest user.\r
  */\r
 function ticketForPlugin(){\r
        global $CONF,$DIR_PLUGINS,$member,$ticketforplugin;\r
-       \r
+\r
        /* initialize */\r
        $ticketforplugin=array();\r
        $ticketforplugin['ticket']=false;\r
-       \r
+\r
        /* Check if using plugin's php file. */\r
        if ($p_translated=serverVar('PATH_TRANSLATED')) {\r
                if (!file_exists($p_translated)) $p_translated='';\r
@@ -1703,13 +1703,13 @@ function ticketForPlugin(){
        $p_translated=str_replace('\\','/',$p_translated);\r
        $d_plugins=str_replace('\\','/',$DIR_PLUGINS);\r
        if (strpos($p_translated,$d_plugins)!==0) return;// This isn't plugin php file.\r
-       \r
+\r
        /* Solve the plugin php file or admin directory */\r
        $phppath=substr($p_translated,strlen($d_plugins));\r
        $phppath=preg_replace('!^/!','',$phppath);// Remove the first "/" if exists.\r
        $path=preg_replace('/^NP_(.*)\.php$/','$1',$phppath); // Remove the first "NP_" and the last ".php" if exists.\r
        $path=preg_replace('!^([^/]*)/(.*)$!','$1',$path); // Remove the "/" and beyond.\r
-       \r
+\r
        /* Solve the plugin name. */\r
        $plugins=array();\r
        $query='SELECT pfile FROM '.sql_table('plugin');\r
@@ -1725,16 +1725,16 @@ function ticketForPlugin(){
                header("HTTP/1.0 404 Not Found");\r
                exit('');\r
        }\r
-       \r
+\r
        /* Return if not index.php */\r
        if ( $phppath!=strtolower($plugin_name).'/'\r
                && $phppath!=strtolower($plugin_name).'/index.php' ) return;\r
-       \r
+\r
        /* Exit if not logged in. */\r
        if ( !$member->isLoggedIn() ) exit("You aren't logged in.");\r
-       \r
+\r
        global $manager,$DIR_LIBS,$DIR_LANG,$HTTP_GET_VARS,$HTTP_POST_VARS;\r
-       \r
+\r
        /* Check if this feature is needed (ie, if "$manager->checkTicket()" is not included in the script). */\r
        if (!($p_translated=serverVar('PATH_TRANSLATED'))) $p_translated=serverVar('SCRIPT_FILENAME');\r
        if ($file=@file($p_translated)) {\r
@@ -1744,7 +1744,7 @@ function ticketForPlugin(){
                        $prevline=$line;\r
                }\r
        }\r
-       \r
+\r
        /* Show a form if not valid ticket */\r
        if ( ( strstr(serverVar('REQUEST_URI'),'?') || serverVar('QUERY_STRING')\r
                        || strtoupper(serverVar('REQUEST_METHOD'))=='POST' )\r
@@ -1764,7 +1764,7 @@ function ticketForPlugin(){
                $oPluginAdmin = new PluginAdmin($plugin_name);\r
                $oPluginAdmin->start();\r
                echo '<p>' . _ERROR_BADTICKET . "</p>\n";\r
-               \r
+\r
                /* Show the form to confirm action */\r
                // PHP 4.0.x support\r
                $get=  (isset($_GET))  ? $_GET  : $HTTP_GET_VARS;\r
@@ -1795,11 +1795,11 @@ function ticketForPlugin(){
                echo '<input type="submit" value="'._YES.'" />&nbsp;&nbsp;&nbsp;&nbsp;';\r
                echo '<input type="button" value="'._NO.'" onclick="history.back(); return false;" />';\r
                echo "</form>\n";\r
-               \r
+\r
                $oPluginAdmin->end();\r
                exit;\r
        }\r
-       \r
+\r
        /* Create new ticket */\r
        $ticket=$manager->addTicketToUrl('');\r
        $ticketforplugin['ticket']=substr($ticket,strpos($ticket,'ticket=')+7);\r
@@ -1817,7 +1817,7 @@ function _addInputTags(&$keys,$prefix=''){
        }\r
 }\r
 \r
-/** \r
+/**\r
  * Convert the server string such as $_SERVER['REQUEST_URI']\r
  * to arry like arry['blogid']=1 and array['page']=2 etc.\r
  */\r
@@ -1835,7 +1835,7 @@ function serverStringToArray($str, &$array, &$frontParam)
                $args = $str;\r
                $frontParam = "";\r
        }\r
-       \r
+\r
        // If there is no args like blogid=1&page=2, return\r
        if (!strstr($str, "=") && !strlen($frontParam)) {\r
                $frontParam = $str;\r
@@ -1845,7 +1845,7 @@ function serverStringToArray($str, &$array, &$frontParam)
        $array = explode("&", $args);\r
 }\r
 \r
-/** \r
+/**\r
  * Convert array like array['blogid'] to server string\r
  * such as $_SERVER['REQUEST_URI']\r
  */\r
@@ -1861,14 +1861,14 @@ function arrayToServerString($array, $frontParam, &$str)
        }\r
 }\r
 \r
-/** \r
+/**\r
  * Sanitize array parameters.\r
  * This function checks both key and value.\r
  * - check key if it inclues " (double quote),  remove from array\r
  * - check value if it includes \ (escape sequece), remove remaining string\r
  */\r
 function sanitizeArray(&$array)\r
-{      \r
+{\r
        $excludeListForSanitization = array('query');\r
 //     $excludeListForSanitization = array();\r
 \r
@@ -1886,22 +1886,22 @@ function sanitizeArray(&$array)
                        $val = stripslashes($val);\r
                }\r
                $val = addslashes($val);\r
-               \r
+\r
                // if $key is included in exclude list, skip this param\r
                if (!in_array($key, $excludeListForSanitization)) {\r
-                               \r
+\r
                        // check value\r
                        @list($val, $tmp) = explode('\\', $val);\r
-                       \r
+\r
                        // remove control code etc.\r
                        $val = strtr($val, "\0\r\n<>'\"", "       ");\r
-                               \r
+\r
                        // check key\r
                        if (preg_match('/\"/i', $key)) {\r
                                unset($array[$k]);\r
                                continue;\r
                        }\r
-                               \r
+\r
                        // set sanitized info\r
                        $array[$k] = sprintf("%s=%s", $key, $val);\r
                }\r
@@ -2046,7 +2046,7 @@ function encode_desc(&$data)
         $data = str_replace('\n', '<br />', $data); //hack\r
         return $data;\r
     }\r
\r
+\r
 /**\r
  * Returns the Javascript code for a bookmarklet that works on most modern browsers\r
  *\r