Mooay 2022 Update – The Tag Update | Revision B (2022-05b)
This PR adds some API Fixes and one UI Fix (improvement)
This commit is contained in:
		@@ -232,6 +232,9 @@ table.footable>tbody>tr.footable-empty>td {
 | 
			
		||||
  font-style:italic;
 | 
			
		||||
  font-size: 1rem;
 | 
			
		||||
}
 | 
			
		||||
table>tbody>tr>td>span.footable-toggle {
 | 
			
		||||
  opacity: 0.75;
 | 
			
		||||
}
 | 
			
		||||
.navbar-nav > li {
 | 
			
		||||
  font-size: 1rem !important;
 | 
			
		||||
}
 | 
			
		||||
@@ -293,3 +296,4 @@ code {
 | 
			
		||||
  align-items: center;
 | 
			
		||||
  display: inline-flex;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -568,6 +568,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
 | 
			
		||||
          ));
 | 
			
		||||
          // save tags
 | 
			
		||||
          foreach($tags as $index => $tag){
 | 
			
		||||
            if (empty($tag)) continue;
 | 
			
		||||
            if ($index > $GLOBALS['TAGGING_LIMIT']) {
 | 
			
		||||
              $_SESSION['return'][] = array(
 | 
			
		||||
                'type' => 'warning',
 | 
			
		||||
@@ -1124,6 +1125,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
 | 
			
		||||
          ));
 | 
			
		||||
          // save tags
 | 
			
		||||
          foreach($tags as $index => $tag){
 | 
			
		||||
            if (empty($tag)) continue;
 | 
			
		||||
            if ($index > $GLOBALS['TAGGING_LIMIT']) {
 | 
			
		||||
              $_SESSION['return'][] = array(
 | 
			
		||||
                'type' => 'warning',
 | 
			
		||||
@@ -2201,8 +2203,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
 | 
			
		||||
                ':gal' => $gal,
 | 
			
		||||
                ':domain' => $domain
 | 
			
		||||
              ));
 | 
			
		||||
              // save tags, tag_name is unique
 | 
			
		||||
              // save tags
 | 
			
		||||
              foreach($tags as $index => $tag){
 | 
			
		||||
                if (empty($tag)) continue;
 | 
			
		||||
                if ($index > $GLOBALS['TAGGING_LIMIT']) {
 | 
			
		||||
                  $_SESSION['return'][] = array(
 | 
			
		||||
                    'type' => 'warning',
 | 
			
		||||
@@ -2368,8 +2371,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
 | 
			
		||||
                ':description' => $description,
 | 
			
		||||
                ':domain' => $domain
 | 
			
		||||
              ));
 | 
			
		||||
              // save tags, tag_name is unique
 | 
			
		||||
              // save tags
 | 
			
		||||
              foreach($tags as $index => $tag){
 | 
			
		||||
                if (empty($tag)) continue;
 | 
			
		||||
                if ($index > $GLOBALS['TAGGING_LIMIT']) {
 | 
			
		||||
                  $_SESSION['return'][] = array(
 | 
			
		||||
                    'type' => 'warning',
 | 
			
		||||
@@ -2712,6 +2716,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
 | 
			
		||||
            ));
 | 
			
		||||
            // save tags
 | 
			
		||||
            foreach($tags as $index => $tag){
 | 
			
		||||
              if (empty($tag)) continue;
 | 
			
		||||
              if ($index > $GLOBALS['TAGGING_LIMIT']) {
 | 
			
		||||
                $_SESSION['return'][] = array(
 | 
			
		||||
                  'type' => 'warning',
 | 
			
		||||
 
 | 
			
		||||
@@ -290,6 +290,7 @@ $(document).ready(function() {
 | 
			
		||||
    var tagValuesElem = $(tagboxElem).find(".tag-values")[0];
 | 
			
		||||
 | 
			
		||||
    var tag = escapeHtml($(tagInputElem).val());
 | 
			
		||||
    if (!tag) return;
 | 
			
		||||
    var value_tags = [];
 | 
			
		||||
    try {
 | 
			
		||||
      value_tags = JSON.parse($(tagValuesElem).val());
 | 
			
		||||
 
 | 
			
		||||
@@ -989,14 +989,19 @@ if (isset($_GET['query'])) {
 | 
			
		||||
                if (isset($_GET['tags']) && $_GET['tags'] != '') 
 | 
			
		||||
                  $tags = explode(',', $_GET['tags']);
 | 
			
		||||
 | 
			
		||||
                $mailboxes = mailbox('get', 'mailboxes', $object, $tags);
 | 
			
		||||
                if (!empty($mailboxes)) {
 | 
			
		||||
                  foreach ($mailboxes as $mailbox) {
 | 
			
		||||
                    if ($details = mailbox('get', 'mailbox_details', $mailbox)) $data[] = $details;
 | 
			
		||||
                    else continue;
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
                if ($tags === null) {
 | 
			
		||||
                  $data = mailbox('get', 'mailbox_details', $object);
 | 
			
		||||
                  process_get_return($data);
 | 
			
		||||
                } else {
 | 
			
		||||
                  $mailboxes = mailbox('get', 'mailboxes', $object, $tags);
 | 
			
		||||
                  if (is_array($mailboxes)) {
 | 
			
		||||
                    foreach ($mailboxes as $mailbox) {
 | 
			
		||||
                      if ($details = mailbox('get', 'mailbox_details', $mailbox)) 
 | 
			
		||||
                        $data[] = $details;
 | 
			
		||||
                    }
 | 
			
		||||
                  }
 | 
			
		||||
                  process_get_return($data, false);
 | 
			
		||||
                }
 | 
			
		||||
              break;
 | 
			
		||||
            }
 | 
			
		||||
          break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user