Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

build_dash_tile_list()

Description

@var path is the real ResourceSpace path (regardless if RS is installed under web root or in a subfolder)
Example:
For http://localhost/trunk/pages/edit.php?ref=-[userref]&uploader=batch the real path is pages/edit.php as
RS handles this via its baseurl when generating absolute paths.

$path = str_replace("{$baseurl}/", "", $link);
$path = str_replace("?{$query}", "", $path);

$link = str_replace($path, "pages/upload_batch.php", $link);
}

return $link;
}

/
Dash Admin Display Functions

#Build dash listfunction

Parameters

ColumnTypeDefaultDescription
$dtiles_available

Location

include/dash_functions.php lines 1410 to 1496

Definition

 
function build_dash_tile_list($dtiles_available)
    {
    global 
$lang,$baseurl_short,$baseurl;
    foreach(
$dtiles_available as $tile)
          {
          
$checked false;
          if(!empty(
$tile["dash_tile"]))
              {
$checked=true;}

          
$buildstring explode('?',$tile["url"]);
        
parse_str(str_replace("&","&",($buildstring[1]??"")),$buildstring);
          
?>
          <tr id="tile echo $tile["ref"];?> if(isset($buildstring["tltype"]) && $buildstring["tltype"]=="conf") {echo "class=\"conftile\"";} ?>>
              <td>
                  <input 
                      type="checkbox" 
                      class="tilecheck" 
                      name="tiles[]" 
                      value=" echo $tile["ref"];?>
                      onChange="changeTile( echo $tile["ref"];?>, echo $tile["all_users"];?>);"
                       echo $checked?"checked":"";?> 
                  />
              </td>
              <td>
                   
                  
if(isset($buildstring["tltype"]) && $buildstring["tltype"]=="conf" && $buildstring["tlstyle"]!="custm" && $buildstring["tlstyle"]!="pend" && isset($lang[$tile["title"]]))
                      {echo 
escape(i18n_get_translated($lang[$tile["title"]]));}
                  else 
                      {echo 
escape(i18n_get_translated($tile["title"]));}
                  
?>
              </td>
              <td>
                   
                  
if(isset($buildstring["tltype"]) && $buildstring["tltype"]=="conf" && $buildstring["tlstyle"]!="custm" && $buildstring["tlstyle"]!="pend")
                      {
$tile["txt"] = text($tile["title"]);}
                  elseif(isset(
$buildstring["tltype"]) && $buildstring["tltype"]=="conf" && $buildstring["tlstyle"]=="pend")
                      {
                    if(isset(
$lang[strtolower($tile['txt'])]))
                        {
                        
$tile['txt'] = escape($lang[strtolower($tile["txt"])]);
                        }
                    else
                        {
                        
$tile['txt'] = escape($tile['txt']);
                        }
                    }
                  
                  if(
strlen($tile["txt"])>75)
                      {
                      echo 
escape(substr(i18n_get_translated($tile["txt"]),0,72)."...");
                      }
                  else
                      {
                      echo 
escape(i18n_get_translated($tile["txt"]));
                      }
                  
?>
              </td>
              <td>
                  <a 
                      href=" echo (mb_strtolower(substr($tile["link"],0,4))=="http")? escape($tile["link"]): $baseurl."/".escape($tile["link"]);?>"
                      target="_blank"
                  >
                       echo escape($lang["dashtilevisitlink"]); ?>
                  </a>
              </td>
              <td> echo $tile["resource_count"]? $lang["yes"]: $lang["no"];?></td>
              <td class="ListTools">
                  
                  
if  ( 
                          
$tile["allow_delete"]
                          &&
                          (
                              (
$tile["all_users"] && checkPermission_dashadmin()) 
                              || 
                              (!
$tile["all_users"] && (checkPermission_dashuser() || checkPermission_dashadmin()))
                          )
                      )
                      { 
?>
                      <a href=" echo $baseurl_short?>pages/dash_tile.php?edit= echo $tile['ref'];?>" ><i class="fas fa-edit"></i>&nbsp; echo escape($lang["action-edit"]);?></a>
                      
                      
}
                  
?>
              </td>
          </tr>
          
          
}
      }

This article was last updated 19th March 2024 11:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.