]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
XML parser introduced, ext-surfbar rewritten, more EL code:
[mailer.git] / inc / libs / surfbar_functions.php
index bb4c68d4a12834f2d58be78d741711387e47ea54..1a1ff0e53e933154297f31bf66fc5598fda6c668 100644 (file)
@@ -199,9 +199,7 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
                $OUT .= loadTemplate('member_surfbar_list_form', true, array(
                        'width'    => $width,
                        'id'       => bigintval($urlId),
-                       'action'   => strtolower($action),
-                       'title'    => '{--MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_TITLE--}',
-                       'submit'   => '{--MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_SUBMIT--}',
+                       'action'   => strtolower($action)
                ));
        } // END - foreach
 
@@ -734,8 +732,56 @@ function translateSurfbarLimit ($limit) {
 
 // Translate the URL status
 function translateSurfbarUrlStatus ($status) {
-       // Return result
-       return sprintf("{--SURFBAR_URL_STATUS_%s--}", strtoupper($status));
+       // NULL must be handled carfefully
+       if (is_null($status)) {
+               // Is NULL, so return other language string
+               return '{--SURFBAR_URL_STATUS_NONE--}';
+       } else {
+               // Return regular result
+               return sprintf("{--SURFBAR_URL_STATUS_%s--}", strtoupper($status));
+       }
+}
+
+// Translates the given action into a link title for members
+function translateMemberSurfbarActionToTitle ($action) {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$action])) {
+               // Construct default return string (unknown
+               $GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_TITLE=' . $action . '%}';
+
+               // ... and the id's name
+               $messageId = 'MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_TITLE';
+
+               // Is the id there?
+               if (isMessageIdValid($messageId)) {
+                       // Then use it
+                       $GLOBALS[__FUNCTION__][$action] = '{--' . $messageId . '--}';
+               } // END - if
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$action];
+}
+
+// Translates the given action into a submit button for members
+function translateMemberSurfbarActionToSubmit ($action) {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$action])) {
+               // Construct default return string (unknown
+               $GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_SUBMIT=' . $action . '%}';
+
+               // ... and the id's name
+               $messageId = 'MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_SUBMIT';
+
+               // Is the id there?
+               if (isMessageIdValid($messageId)) {
+                       // Then use it
+                       $GLOBALS[__FUNCTION__][$action] = '{--' . $messageId . '--}';
+               } // END - if
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$action];
 }
 
 // Determine reward