Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

build_dash_tile_list()

Parameters

ColumnTypeDefaultDescription
$dtiles_available

Location

include/dash_functions.php lines 1480 to 1566

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 escape($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 8th December 2024 10:05 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.