livecart /application/helper/smarty/function.uniqid.php

Language PHP Lines 39
MD5 Hash 3ad571cf1f33eccb7a6ea59c0dfea878 Estimated Cost $468 (why?)
Repository git://github.com/integry/livecart.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

/**
 * ...
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 *
 * @package application.helper.smarty
 * @author Integry Systems
 */
function smarty_function_uniqid($params, Smarty_Internal_Template $smarty)
{
	if (isset($params['last']))
	{
		return $smarty->getTemplateVars('lastUniqId');
	}
	else
	{
		// start with a letter for XHTML id attribute value compatibility
		$id = 'a' . uniqid();
		$smarty->assign('lastUniqId', $id);

		if (isset($params['assign']))
		{
			$smarty->assign($params['assign'], $id);

			if (!empty($params['noecho']))
			{
				return '';
			}
		}

		return $id;
	}
}

?>
Back to Top