本文整理汇总了PHP中G::createUID方法的典型用法代码示例。如果您正苦于以下问题:PHP G::createUID方法的具体用法?PHP G::createUID怎么用?PHP G::createUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::createUID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateUID
/**
* @covers G::createUID
* @todo Implement testCreateUID().
*/
public function testCreateUID()
{
$uidTest001 = 'cDhpajRHQ2paUQ______';
$responseUID = G::createUID('test', '001');
$this->assertEquals($responseUID, $uidTest001);
}
示例2: getConditionCasesList
//.........这里部分代码省略.........
$c->add(
$c->getNewCriterion(
AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED'
)->addOr(
$c->getNewCriterion(
ApplicationPeer::APP_STATUS, 'COMPLETED'
)->addAnd(
$c->getNewCriterion(AppDelegationPeer::DEL_PREVIOUS, 0)
)
)
);
$c->add($c->getNewCriterion(ApplicationPeer::APP_UID, $aProcesses, Criteria::NOT_IN));
$c->addDescendingOrderByColumn(ApplicationPeer::APP_NUMBER);
break;
}
//select the xmlList to show
if ($sTypeList == 'gral') {
if ($RBAC->userCanAccess('PM_DELETECASE') == 1) {
$xmlfile = $filesList['Alldelete'];
} else {
$xmlfile = $filesList['all'];
}
} else {
$xmlfile = $filesList[$sTypeList];
}
if ($ClearSession) {
//OPCION_1: claening the $_SESSION and updating the List.... only case List
foreach ($filesList as $file) {
$id = G::createUID('', $file . '.xml');
unset($_SESSION['pagedTable[' . $id . ']']);
unset($_SESSION[$id]);
}
//OPTION_2: cleaning the $_SESSION and whole List and xmls
$cur = array_keys($_SESSION);
foreach ($cur as $key) {
if (substr($key, 0, 11) === "pagedTable[") {
unset($_SESSION[$key]);
} else {
$xml = G::getUIDName($key, '');
if (strpos($xml, '.xml') !== false) {
unset($_SESSION[$key]);
}
}
}
}
return array($c, $xmlfile);
}
示例3: parseFile
/**
* Function xmlformTemplate
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @param string form
* @param string templateFile
* @return string
*/
public function parseFile($filename, $language, $forceParse)
{
$this->language = $language;
$filenameInitial = $filename;
$filename = $this->home . $filename;
//if the xmlform file doesn't exists, then try with the plugins folders
if (!is_file($filename)) {
$aux = explode(PATH_SEP, $filenameInitial);
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
if (count($aux) > 2) {
//Subfolders
$filename = array_pop($aux);
$aux0 = implode(PATH_SEP, $aux);
$aux = array();
$aux[0] = $aux0;
$aux[1] = $filename;
}
if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($response = $oPluginRegistry->isRegisteredFolder($aux[0])) {
if ($response !== true) {
$sPath = PATH_PLUGINS . $response . PATH_SEP;
} else {
$sPath = PATH_PLUGINS;
}
$filename = $sPath . $aux[0] . PATH_SEP . $aux[1];
}
}
}
$this->fileName = $filename;
$parsedFile = dirname($filename) . PATH_SEP . basename($filename, 'xml') . $language;
$parsedFilePath = defined('PATH_C') ? defined('SYS_SYS') ? PATH_C . 'ws' . PATH_SEP . SYS_SYS . PATH_SEP : PATH_C : PATH_DATA;
$parsedFilePath .= 'xmlform/' . substr($parsedFile, strlen($this->home));
// Improvement for the js cache - Start
$realPath = substr(realpath($this->fileName), strlen(realpath($this->home)), -4);
if (substr($realPath, 0, 1) != PATH_SEP) {
$realPath = PATH_SEP . $realPath;
}
$filesToDelete = substr((defined('PATH_C') ? PATH_C : PATH_DATA) . 'xmlform/', 0, -1) . $realPath . '.*.js';
$auxPath = explode(PATH_SEP, $realPath);
$auxPath[count($auxPath) - 1] = $auxPath[count($auxPath) - 1] . '.' . md5(filemtime($this->fileName));
$realPath = implode(PATH_SEP, $auxPath);
// Improvement for the js cache - End
$this->parsedFile = $parsedFilePath;
$this->scriptURL = '/jsform' . $realPath . '.js';
$this->scriptFile = substr((defined('PATH_C') ? PATH_C : PATH_DATA) . 'xmlform/', 0, -1) . substr($this->scriptURL, 7);
$this->id = G::createUID('', substr($this->fileName, strlen($this->home)));
$this->scriptURL = str_replace('\\', '/', $this->scriptURL);
$newVersion = false;
if ($forceParse || (!file_exists($this->parsedFile) || filemtime($filename) > filemtime($this->parsedFile) || filemtime(__FILE__) > filemtime($this->parsedFile)) || !file_exists($this->scriptFile) || filemtime($filename) > filemtime($this->scriptFile)) {
if (glob($filesToDelete)) {
foreach (glob($filesToDelete) as $fileToDelete) {
@unlink($fileToDelete);
}
}
$this->tree = new Xml_Document();
$this->tree->parseXmlFile($filename);
//$this->tree->unsetParent();
if (!is_object($this->tree->children[0])) {
throw new Exception('Failure loading root node.');
}
$this->tree =& $this->tree->children[0]->toTree();
//ERROR CODE [1] : Failed to read the xml document
if (!isset($this->tree)) {
return 1;
}
$xmlNode =& $this->tree->children;
//Set the form's attributes
$myAttributes = get_class_vars(get_class($this));
foreach ($myAttributes as $k => $v) {
$myAttributes[$k] = strtolower($k);
}
foreach ($this->tree->attributes as $k => $v) {
$key = array_search(strtolower($k), $myAttributes);
if ($key !== false && strtolower($k) !== 'fields' && strtolower($k) !== 'values') {
$this->{$key} = $v;
}
}
//Reeplace non valid characters in xmlform name with "_"
$this->name = preg_replace('/\\W/', '_', $this->name);
//Create fields
foreach ($xmlNode as $k => $v) {
if ($xmlNode[$k]->type !== 'cdata' && isset($xmlNode[$k]->attributes['type'])) {
if (class_exists('XmlForm_Field_' . $xmlNode[$k]->attributes['type'])) {
$x = '$field = new XmlForm_Field_' . $xmlNode[$k]->attributes['type'] . '( $xmlNode[$k], $language, $this->home, $this);';
eval($x);
} else {
$field = new XmlForm_Field($xmlNode[$k], $language, $this->home, $this);
}
$field->language = $this->language;
$this->fields[$field->name] = $field;
//.........这里部分代码省略.........
示例4: renderTitle
/**
* Function renderTitle
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @return string
*/
public function renderTitle()
{
//fix the bug about showing hidden fields in propel table.
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['type'] == 'hidden') {
$this->style[$r]['showInTable'] = '0';
}
}
//Render headers
$this->colCount = 0;
$this->shownFields = '[';
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['showInTable'] != '0' && !in_array($this->fields[$r]['Name'], $this->masterdetail)) {
//if (($this->style[$r]['showInTable'] != '0' ))
$this->tpl->newBlock("headers");
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'ASC' ? 'DESC' : 'ASC';
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'DESC' ? '' : $sortOrder;
if ($this->style[$r]['titleVisibility'] != '0') {
$this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? G::createUID('', $this->fields[$r]['Name']) . '=' . $sortOrder : '') . '&page=' . $this->currentPage;
$this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID('', $this->fields[$r]['Name']) . '" , "' . $sortOrder . '");return false;';
} else {
$this->style[$r]['href'] = '#';
$this->style[$r]['onsort'] = 'return false;';
}
if (isset($this->style[$r]['href'])) {
$this->tpl->assign("href", $this->style[$r]['href']);
}
if (isset($this->style[$r]['onsort'])) {
$this->tpl->assign("onsort", htmlentities($this->style[$r]['onsort'], ENT_QUOTES, 'UTF-8'));
}
/* BUG 8080 - erik: don't setup onclick on page table header, doesn't have sense and causing problems
if (isset($this->style[$r]['onclick']))
$this->tpl->assign( "onclick" , htmlentities( $this->style[$r]['onclick'] , ENT_QUOTES, 'UTF-8' ) );
*/
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("width", $this->style[$r]['colWidth']);
}
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("widthPercent", $this->style[$r]['colWidth'] * 100 / $this->totalWidth . "%");
//Hook for special skin with RTL languajes
}
if (defined('SYS_LANG_DIRECTION') && SYS_LANG_DIRECTION == 'R') {
$this->style[$r]['titleAlign'] = 'right';
}
if (isset($this->style[$r]['titleAlign'])) {
$this->tpl->assign("align", 'text-align:' . $this->style[$r]['titleAlign'] . ';');
}
if ($this->style[$r]['titleVisibility'] != '0') {
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'ASC' ? '<img src="/images/arrow-up.gif">' : '';
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'DESC' ? '<img src="/images/arrow-down.gif">' : $sortOrder;
$this->tpl->assign("header", $this->fields[$r]['Label'] . $sortOrder);
$this->tpl->assign('displaySeparator', $this->colCount == 0 || !isset($this->fields[$r]['Label']) || $this->fields[$r]['Label'] === '' ? 'display:none;' : '');
} else {
$this->tpl->assign('displaySeparator', 'display:none;');
}
$this->colCount += 2;
$this->shownFields .= $this->shownFields !== '[' ? ',' : '';
$this->shownFields .= '"' . $r . '"';
}
}
$this->shownFields .= ']';
}
示例5: renderTitle
/**
* Function renderTitle
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @return string
*/
function renderTitle()
{
//Render Title
$thereisnotitle = true;
foreach ($this->fields as $r => $rval) {
if ($this->fields[$r]['Type'] === 'title') {
$this->tpl->assign("title", $this->fields[$r]['Label']);
$thereisnotitle = false;
}
}
if ($thereisnotitle) {
$this->tpl->assign("title", ' ');
}
//Render headers
$this->colCount = 0;
$this->shownFields = '[';
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['showInTable'] != '0') {
$this->tpl->newBlock("headers");
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'ASC' ? 'DESC' : 'ASC';
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'DESC' ? '' : $sortOrder;
$this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? urlencode(G::createUID('', $this->fields[$r]['Name']) . '=' . $sortOrder) : '') . '&page=' . $this->currentPage;
$this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID('', $this->fields[$r]['Name']) . '" , "' . $sortOrder . '");return false;';
if (isset($this->style[$r]['href'])) {
$this->tpl->assign("href", $this->style[$r]['href']);
}
if (isset($this->style[$r]['onsort'])) {
$this->tpl->assign("onclick", htmlentities($this->style[$r]['onsort'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("width", $this->style[$r]['colWidth']);
}
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("widthPercent", $this->style[$r]['colWidth'] * 100 / $this->totalWidth . "%");
}
if (isset($this->style[$r]['titleAlign'])) {
$this->tpl->assign("align", 'text-align:' . $this->style[$r]['titleAlign'] . ';');
}
if ($this->style[$r]['titleVisibility'] != '0') {
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'ASC' ? 'b2' : '';
$sortOrder = isset($this->aOrder[$this->fields[$r]['Name']]) && $this->aOrder[$this->fields[$r]['Name']] === 'DESC' ? 'b<' : $sortOrder;
$this->tpl->assign("header", $this->fields[$r]['Label'] . $sortOrder);
$this->tpl->assign('displaySeparator', $this->colCount == 0 || !isset($this->fields[$r]['Label']) || $this->fields[$r]['Label'] === '' ? 'display:none;' : '');
} else {
$this->tpl->assign('displaySeparator', 'display:none;');
}
$this->colCount += 2;
$this->shownFields .= $this->shownFields !== '[' ? ',' : '';
$this->shownFields .= '"' . $r . '"';
}
}
$this->shownFields .= ']';
}
示例6: count
$t->can_ok($obj, 'LoadTemplate', 'LoadTemplate()');
$t->can_ok($obj, 'LoadClassRBAC', 'LoadClassRBAC()');
$t->can_ok($obj, 'LoadClass', 'LoadClass()');
$t->can_ok($obj, 'LoadThirdParty', 'LoadThirdParty()');
$t->can_ok($obj, 'encryptlink', 'encryptlink()');
$t->is(G::encryptlink("normal url"), "normal url", 'encryptlink() normal url');
$t->todo('more tests with encryplink and remove ENABLE_ENCRYPT dependency');
$t->can_ok($obj, 'parseURI', 'parseURI()');
G::parseURI("http:/192.168.0.9/sysos/en/wf5/login/login/abc?ab=123&bc=zy");
$t->todo('more tests with parseURI');
$t->can_ok($obj, 'streamFile', 'streamFile()');
$t->can_ok($obj, 'sendHeaders', 'sendHeaders()');
$t->todo('more tests with sendHeaders');
$t->can_ok($obj, 'virtualURI', 'virtualURI()');
$t->can_ok($obj, 'createUID', 'createUID()');
$t->is(G::createUID('directory', 'filename'), 'bDh5aTBaUG5vNkxwMnByWjJxT2EzNVk___', 'createUID() normal');
$t->can_ok($obj, 'getUIDName', 'getUIDName()');
$t->is(G::getUIDName('bDh5aTBaUG5vNkxwMnByWjJxT2EzNVk___', '12345678901234567890'), false, 'getUIDName() normal?');
$t->can_ok($obj, 'formatNumber', 'formatNumber()');
$t->is(G::formatNumber('100000'), '100000', 'formatNumber() normal');
$t->todo('is useful the function formatNumber??');
$t->can_ok($obj, 'formatDate', 'formatDate()');
$t->is(G::formatDate('2001-02-29'), '2001-02-29', 'formatDate() ');
$t->is(G::formatDate('2001-02-29', 'F d, Y'), 'Februar01 29, 2001', 'formatDate() ');
//is not working
$t->is(G::formatDate('2001-02-29', 'd.m.Y'), '29.02.2001', 'formatDate() ');
$t->todo(" the month literal text is defined here!! ");
$t->todo('review all methods in class G');
$i = 1;
$t->diag('class G');
$t->is(count($methods), 95, "class database " . count($methods) . " methods.");
示例7: renderTitle
/**
* Function renderTitle
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @return string
*/
public function renderTitle()
{
//fix the bug about showing hidden fields in propel table.
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['type'] == 'hidden') {
$this->style[$r]['showInTable'] = '0';
}
}
//Render headers
$this->colCount = 0;
$this->shownFields = '[';
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['showInTable'] != '0' && !in_array($this->fields[$r]['Name'], $this->masterdetail)) {
//if (($this->style[$r]['showInTable'] != '0' ))
$this->tpl->newBlock("headers");
$sortDir = "ASC";
if (isset($this->aOrder[$this->fields[$r]["Name"]])) {
$sortDir = $this->aOrder[$this->fields[$r]["Name"]] == "ASC" ? "DESC" : "ASC";
}
if ($this->style[$r]['titleVisibility'] != '0') {
$this->style[$r]["href"] = "javascript:;";
$this->style[$r]["onsort"] = $this->id . ".doSort(\"" . G::createUID("", $this->fields[$r]["Name"]) . "\", \"" . ($this->sortable == "0" ? "" : $sortDir) . "\"); return false;";
} else {
$this->style[$r]["href"] = "javascript:;";
$this->style[$r]['onsort'] = 'return false;';
}
if (isset($this->style[$r]['href'])) {
$this->tpl->assign("href", $this->style[$r]['href']);
}
if (isset($this->style[$r]['onsort'])) {
$this->tpl->assign("onsort", htmlentities($this->style[$r]['onsort'], ENT_QUOTES, 'UTF-8'));
}
/* BUG 8080 - erik: don't setup onclick on page table header, doesn't have sense and causing problems
if (isset($this->style[$r]['onclick']))
$this->tpl->assign( "onclick" , htmlentities( $this->style[$r]['onclick'] , ENT_QUOTES, 'UTF-8' ) );
*/
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("width", $this->style[$r]['colWidth']);
}
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("widthPercent", $this->style[$r]['colWidth'] * 100 / $this->totalWidth . "%");
//Hook for special skin with RTL languajes
}
if (defined('SYS_LANG_DIRECTION') && SYS_LANG_DIRECTION == 'R') {
$this->style[$r]['titleAlign'] = 'right';
}
if (isset($this->style[$r]['titleAlign'])) {
$this->tpl->assign("align", 'text-align:' . $this->style[$r]['titleAlign'] . ';');
}
if ($this->style[$r]['titleVisibility'] != '0') {
$sortDirImg = "";
if (isset($this->aOrder[$this->fields[$r]["Name"]])) {
$sortDirImg = $this->aOrder[$this->fields[$r]["Name"]] == "ASC" ? "<img src=\"/images/arrow-up.gif\" />" : "<img src=\"/images/arrow-down.gif\" />";
}
$this->tpl->assign("header", $this->fields[$r]["Label"] . $sortDirImg);
$this->tpl->assign("displaySeparator", $this->colCount == 0 || !isset($this->fields[$r]["Label"]) || $this->fields[$r]["Label"] == "" ? "display: none;" : "");
} else {
$this->tpl->assign('displaySeparator', 'display:none;');
}
$this->colCount += 2;
$this->shownFields .= $this->shownFields !== '[' ? ',' : '';
$this->shownFields .= '"' . $r . '"';
}
}
$this->shownFields .= ']';
}