Page 1 of 1

home page, how to add info on the tables displayed

Posted: 2015-04-14 13:58
by omphilesithole
i have the following code on my home page and i want to add text that explains each table how can i to that

Code: Select all

<div class="row" id="table_links">
	<?php
		/* accessible tables */
		if(is_array($arrTables) && count($arrTables)){
			$i=0;
			foreach($arrTables as $tn=>$tc){
				$tChkFF = array_search($tn, array());
				$tChkHL = array_search($tn, array());
				if($tChkHL !== false && $tChkHL !== null) continue;

				$searchFirst = (($tChkFF !== false && $tChkFF !== null) ? '?Filter_x=1' : '');
				?>
				
				<div align="center" id="<?php echo $tn; ?>-tile" class=" <?php echo (  $block_classes['other']['grid_column']); ?>">
					<div class="">
						<div class="container1"><br><br><br><br>
							<a class="" title="<?php echo preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", htmlspecialchars(strip_tags($tc[1]))); ?>" href="<?php echo $tn; ?>_view.php<?php echo $searchFirst; ?>"><?php echo ($tc[2] ? '<img src="">' : '');?><strong><font size="4"><?php echo $tc[0]; ?></font></strong></a><br><br>
							<div class=""><?php echo $tc[1]; ?></div>
						</div>
					</div>
				</div>
				
				<?php
				$i++;
			}
		}else{
			?><script>window.location='index.php?signIn=1';</script><?php
		}
	?>
</div>

Re: home page, how to add info on the tables displayed

Posted: 2015-04-15 08:22
by a.gneady
In AppGini, add your explanation text to the "Description" box of the concerned table.

Re: home page, how to add info on the tables displayed

Posted: 2015-04-15 11:05
by omphilesithole
Thanks i have sorted it on the pade inccommon.php on the function:
function getTableList($skip_authentication = false){
$arrAccessTables = array();
$arrTables = array(
'crimereport' => array('Incident Reports', 'All Reported Incidents are found here, coming from the Mobile App, Calls and Radio channels', 'table.gif')
}

I have added the description on the second parameter and called it by saying <div class=""><?php echo $tc[1]; ?></div> and it worked!!!

Solved!!!!!!

Re: home page, how to add info on the tables displayed

Posted: 2015-04-20 22:02
by trumedio
In which file do I see the description text I add to the table or is it stored in the database?

Re: home page, how to add info on the tables displayed

Posted: 2015-04-20 22:48
by peebee
You find the generated "Description" text in templates/tablename_templateDV.html

Find the field concerned and you'll see a <div class="alert alert-info"> - see example below. The description text is within the <div> and you can edit and replace it directly if desired.

<span class="help-block collapse" id="fieldname-description"><div class="alert alert-info">This is the Description text you entered in your AppGini project for this particular field</div></span>

Re: home page, how to add info on the tables displayed

Posted: 2015-04-20 22:56
by peebee
I just re-read your post and now see that you actually asked where is "the description text I add to the table". Sorry, the info above was for the field description text.

You'll find the table description text in incCommon.php Search for the following code:

function getTableList(){
$arrTables=array(
'yourtablename'=>array('Table Title', 'This is your description.', 'resources/table_icons/table-icon.png')

Hope that helps.

EDIT: that code above is Appgini V5.30. I see in V5.31 it is now:
function getTableList($skip_authentication = false){
$arrAccessTables = array();
$arrTables = array(
'yourtablename'=>array('Table Title', 'This is your description.', 'resources/table_icons/table-icon.png')

as per omphilesithole's post above.