本文整理汇总了PHP中Singleton::itext方法的典型用法代码示例。如果您正苦于以下问题:PHP Singleton::itext方法的具体用法?PHP Singleton::itext怎么用?PHP Singleton::itext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Singleton
的用法示例。
在下文中一共展示了Singleton::itext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sItext
function sItext()
{
return Singleton::itext();
}
示例2: getParents
/**
* Gets the parents of the specified File
*
* @param int $fileId File Id
* @return array Array of parent Files
*/
function getParents($fileId)
{
if ($this->permissions->checkInternal($this->_uid, $fileId, "RREAD")) {
$parentnodes = $this->tree->getParents($fileId);
if ($parentnodes[0] === NULL) {
return array();
}
$parentnodeidsql = implode(",", $parentnodes);
$sql = "SELECT\n\t\t\t\tgroup2.LFT, group2.RGT, group2.VERSIONPUBLISHED, group2.ID AS ID, group2.LEVEL AS LEVEL, group2.PARENT AS PARENT, prop.FOLDER AS FOLDER,\n\t\t\t\tMAX(prop.VERSION) AS VERSION, prop.LOCKED AS LOCKED, pv.*\n\t\t\t\tFROM\n\t\t\t\t({$this->table} AS group2, yg_files_properties AS prop)\n\t\t\t\tLEFT JOIN yg_files_propsv AS pv ON pv.OID = prop.ID\n\t\t\t\tWHERE\n\t\t\t\t(group2.ID = prop.OBJECTID) AND (group2.ID IN ({$parentnodeidsql}))\n\t\t\t\tGROUP BY\n\t\t\t\tgroup2.LFT, group2.RGT, group2.VERSIONPUBLISHED, group2.ID order by group2.LEVEL DESC;";
$dbr = sYDB()->Execute($sql);
$parentsO = $dbr->GetArray();
// Prepare weird array dimension
$parents = array();
for ($i = 0; $i < count($parentsO); $i++) {
$parents[$i][] = $parentsO[$i];
}
if (count($parents) > 0) {
$itext = Singleton::itext();
$parents[count($parents) - 1][0]['NAME'] = $itext['TXT_FILES'];
}
return $parents;
} else {
return false;
}
}
示例3: add
/**
* Adds a new Template
*
* @param int $parentTemplateId Parent Template Id
* @param int $folder (optional) Specifies if the new node should be a folder
* @return int|false The new Template Id or FALSE in case of an error
*/
function add($parentTemplateId, $folder = 0)
{
$parentTemplateId = (int) $parentTemplateId;
$folder = (int) $folder;
$rread = $this->permissions->checkInternal($this->_uid, $parentTemplateId, "RSUB");
if ($rread && sUsergroups()->permissions->check($this->_uid, 'RTEMPLATES')) {
// Knoten im Pagestree erzeugen
$templateId = $this->tree->add($parentTemplateId);
$itext = Singleton::itext();
$text = sYDB()->escape_string($itext['TXT_NEW_OBJECT']);
$sql = "INSERT INTO `yg_templates_properties` (`OBJECTID`, `FOLDER`, `NAME`) VALUES (?, ?, ?);";
$result = sYDB()->Execute($sql, $templateId, $folder, $text);
if ($result === false) {
throw new Exception(sYDB()->ErrorMsg());
}
$this->permissions->copyTo($parentTemplateId, $templateId);
return $templateId;
} else {
return false;
}
}