Esempio n. 1
0
function compilePreValues()
{
    $GLOBALS['MySQL']->cleanCache('sys_prevalues_keys');
    $aPreValues = array();
    $aKeys = getPreKeys();
    foreach ($aKeys as $aKey) {
        $sKey = $aKey['Key'];
        $aPreValues[$sKey] = array();
        $aRows = getPreValues($sKey);
        foreach ($aRows as $aRow) {
            $aPreValues[$sKey][$aRow['Value']] = array();
            foreach ($aRow as $sValKey => $sValue) {
                if ($sValKey == 'Key' or $sValKey == 'Value' or $sValKey == 'Order') {
                    continue;
                }
                //skip key, value and order. they already used
                if (!strlen($sValue)) {
                    continue;
                }
                //skip empty values
                $aPreValues[$sKey][$aRow['Value']][$sValKey] = $sValue;
            }
        }
    }
    $oCache = $GLOBALS['MySQL']->getDbCacheObject();
    $oCache->setData($GLOBALS['MySQL']->genDbCacheKey('sys_pre_values'), $aPreValues);
    $GLOBALS['aPreValues'] = $aPreValues;
}
Esempio n. 2
0
function genListRows($sList)
{
    global $aFields;
    $aRows = getPreValues($sList);
    ?>
        <tr class="headers">
    <?php 
    foreach ($aFields as $sField => $sHelp) {
        ?>
            <th>
                <span class="tableLabel" onmouseover="showFloatDesc( '<?php 
        echo bx_js_string($sHelp);
        ?>
' );" onmousemove="moveFloatDesc( event );" onmouseout="hideFloatDesc();"><?php 
        echo $sField;
        ?>
</span>
            </th>
        <?php 
    }
    ?>
            <th>&nbsp;</th>
        </tr>
	<?php 
    $iCounter = 0;
    foreach ($aRows as $aRow) {
        ?>
        <tr>
        <?php 
        foreach ($aFields as $sField => $sHelp) {
            echo '<td><input type="text" class="value_input" name="PreList[' . $iCounter . '][' . $sField . ']" value="' . htmlspecialchars($aRow[$sField]) . '" /></td>';
        }
        ?>
            <th class="row_controls"><a class="row_control bx-def-margin-thd-left-auto" href="javascript:void(0)" onclick="javascript:delRow(this);" title="<?php 
        echo bx_html_attribute(_t('_Delete'));
        ?>
"><i class="sys-icon times"></i></a><a class="row_control bx-def-margin-thd-left-auto" href="javascript:void(0)" onclick="javascript:moveUpRow(this);" title="<?php 
        echo bx_html_attribute(_t('_adm_pvalues_txt_move_up'));
        ?>
"><i class="sys-icon arrow-up"></i></a><a class="row_control bx-def-margin-thd-left-auto" href="javascript:void(0)" onclick="javascript:moveDownRow(this);" title="<?php 
        echo bx_html_attribute(_t('_adm_pvalues_txt_move_down'));
        ?>
"><i class="sys-icon arrow-down"></i></a></th>
        </tr>
	<?php 
        $iCounter++;
    }
    ?>
        <tr class="headers">
            <td colspan="<?php 
    echo count($aFields);
    ?>
">&nbsp;</td>
            <th class="row_controls">
				<a class="row_control" href="javascript:void(0)" onclick="javascript:addRow(this);" title="<?php 
    echo bx_html_attribute(_t('_adm_pvalues_txt_add_record'));
    ?>
"><i class="sys-icon plus"></i></a>
            </th>
        </tr>
    <?php 
    return $iCounter;
}
Esempio n. 3
0
function genListRows($sList)
{
    global $aFields;
    $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif');
    $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif');
    $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif');
    $aRows = getPreValues($sList);
    ?>
		<tr class="headers">
	<?php 
    foreach ($aFields as $sField => $sHelp) {
        ?>
			<th>
				<span class="tableLabel"
				  onmouseover="showFloatDesc( '<?php 
        echo addslashes(htmlspecialchars($sHelp));
        ?>
' );"
				  onmousemove="moveFloatDesc( event );"
				  onmouseout="hideFloatDesc();">
					<?php 
        echo $sField;
        ?>
				</span>
			</th>
		<?php 
    }
    ?>
			<th>&nbsp;</th>
		</tr>
	<?php 
    $iCounter = 0;
    foreach ($aRows as $aRow) {
        ?>
		<tr>
		<?php 
        foreach ($aFields as $sField => $sHelp) {
            ?>
			<td><input type="text" class="value_input" name="PreList[<?php 
            echo $iCounter;
            ?>
][<?php 
            echo $sField;
            ?>
]" value="<?php 
            echo htmlspecialchars($aRow[$sField]);
            ?>
" /></td>
			<?php 
        }
        ?>
			<th><img src="<?php 
        echo $sDeleteIcon;
        ?>
"     class="row_control" title="Delete"    alt="Delete" onclick="delRow( this );" /><img src="<?php 
        echo $sUpIcon;
        ?>
"   class="row_control" title="Move up"   alt="Move up" onclick="moveUpRow( this );" /><img src="<?php 
        echo $sDownIcon;
        ?>
" class="row_control" title="Move down" alt="Move down" onclick="moveDownRow( this );" /></th>
		</tr>
		<?php 
        $iCounter++;
    }
    ?>
		<tr class="headers">
			<td colspan="<?php 
    echo count($aFields);
    ?>
">&nbsp;</td>
			<th>
                <img src="<?php 
    echo $GLOBALS['oAdmTemplate']->getImageUrl('plus1.gif');
    ?>
" class="row_control" title="Add" alt="Add" onclick="addRow( this );" />
			</th>
		</tr>
	<?php 
    return $iCounter;
}
Esempio n. 4
0
function genListRows($sList)
{
    global $aFields;
    $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif');
    $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif');
    $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif');
    $sTxtDelete = bx_html_attribute(_t('_Delete'));
    $sTxtMoveUp = bx_html_attribute(_t('_adm_pvalues_txt_move_up'));
    $sTxtMoveDown = bx_html_attribute(_t('_adm_pvalues_txt_move_down'));
    $sTxtAdd = bx_html_attribute(_t('_adm_pvalues_txt_add_record'));
    $aRows = getPreValues($sList);
    ?>
        <tr class="headers">
    <?php 
    foreach ($aFields as $sField => $sHelp) {
        ?>
            <th>
                <span class="tableLabel"
                  onmouseover="showFloatDesc( '<?php 
        echo bx_js_string($sHelp);
        ?>
' );"
                  onmousemove="moveFloatDesc( event );"
                  onmouseout="hideFloatDesc();">
                    <?php 
        echo $sField;
        ?>
                </span>
            </th>
        <?php 
    }
    ?>
            <th>&nbsp;</th>
        </tr>
    <?php 
    $iCounter = 0;
    foreach ($aRows as $aRow) {
        ?>
        <tr>
        <?php 
        foreach ($aFields as $sField => $sHelp) {
            ?>
            <td><input type="text" class="value_input" name="PreList[<?php 
            echo $iCounter;
            ?>
][<?php 
            echo $sField;
            ?>
]" value="<?php 
            echo htmlspecialchars($aRow[$sField]);
            ?>
" /></td>
            <?php 
        }
        ?>
            <th><img src="<?php 
        echo $sDeleteIcon;
        ?>
" class="row_control" title="<?php 
        echo $sTxtDelete;
        ?>
" alt="<?php 
        echo $sTxtDelete;
        ?>
" onclick="delRow( this );" /><img src="<?php 
        echo $sUpIcon;
        ?>
" class="row_control" title="<?php 
        echo $sTxtMoveUp;
        ?>
" alt="<?php 
        echo $sTxtMoveUp;
        ?>
" onclick="moveUpRow( this );" /><img src="<?php 
        echo $sDownIcon;
        ?>
" class="row_control" title="<?php 
        echo $sTxtMoveDown;
        ?>
" alt="<?php 
        echo $sTxtMoveDown;
        ?>
" onclick="moveDownRow( this );" /></th>
        </tr>
        <?php 
        $iCounter++;
    }
    ?>
        <tr class="headers">
            <td colspan="<?php 
    echo count($aFields);
    ?>
">&nbsp;</td>
            <th>
                <img src="<?php 
    echo $GLOBALS['oAdmTemplate']->getImageUrl('plus1.gif');
    ?>
" class="row_control" title="<?php 
    echo $sTxtAdd;
    ?>
" alt="<?php 
    echo $sTxtAdd;
    ?>
" onclick="addRow( this );" />
            </th>
        </tr>
    <?php 
    return $iCounter;
}