本文整理汇总了PHP中Tags::getParents方法的典型用法代码示例。如果您正苦于以下问题:PHP Tags::getParents方法的具体用法?PHP Tags::getParents怎么用?PHP Tags::getParents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tags
的用法示例。
在下文中一共展示了Tags::getParents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$parameters = array('source' => $source, 'target' => $target, 'openerRef' => $parentwindow, 'before' => $before);
$koala->callJSFunction('Koala.yg_confirm', $itext['TXT_MOVE_TAG'] != '' ? $itext['$TXT_MOVE_TAG'] : '$TXT_MOVE_TAG', $itext['TXT_REALLY_MOVE_TAG'] != '' ? $itext['TXT_REALLY_MOVE_TAG'] : '$TXT_REALLY_MOVE_TAG', $action, json_encode($parameters));
} else {
if ($confirmed == 'true' && $positive == 'true') {
$hasMoved = true;
foreach ($source as $source_item) {
if ($tagMgr->tree->moveTo($source_item, $target)) {
$jsQueue->add($source_item, HISTORYTYPE_TAG, 'TAG_MOVE', sGuiUS(), $target);
} else {
$hasMoved = false;
$koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
}
}
if ($hasMoved) {
$parent_ids = array();
$parents = $tagMgr->getParents($source);
foreach ($parents as $parent_item) {
array_push($parent_ids, $parent_item[0]['ID']);
}
$parent_ids = array_reverse($parent_ids);
array_shift($parent_ids);
array_push($parent_ids, $source);
$parent_ids = implode(',', $parent_ids);
$icons = new Icons();
$tagInfo = $tagMgr->get($source);
$koala->callJSFunction('Koala.yg_selectTreeNode', $parentwindow, 'page', $source[0]);
}
}
}
break;
case 'addTagChildFolder':
示例2: array
$koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
}
break;
case 'moveTemplate':
$source = $this->params['source'];
$target = $this->params['target'];
$parentwindow = $this->params['openerRef'];
$before = $this->params['before'];
$confirmed = $this->params['confirmed'];
$positive = $this->params['positive'];
if ($source == $target) {
break;
}
if ($templateMgr->tree->moveTo($source, $target)) {
$parent_ids = array();
$parents = $tagMgr->getParents($source);
foreach ($parents as $parent_item) {
array_push($parent_ids, $parent_item[0]['ID']);
}
$parent_ids = array_reverse($parent_ids);
array_shift($parent_ids);
array_push($parent_ids, $source);
$parent_ids = implode(',', $parent_ids);
$koala->callJSFunction('if (typeof(Koala.yg_dndOnSuccess) == "function") Koala.yg_dndOnSuccess');
$koala->callJSFunction('Koala.yg_selectTreeNode', $parentwindow, 'page', $source);
} else {
$koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
}
break;
case 'uploadTemplate':
$filetype = $this->params['type'];
示例3: getQueuedCommands
//.........这里部分代码省略.........
break;
case 'OBJECT_CHANGE':
if ($queuedCommandRaw['TEXT']) {
$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_change(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . addslashes($queuedCommandRaw['VALUE1']) . '\', \'' . addslashes($queuedCommandRaw['VALUE2']) . '\', \'' . addslashes($queuedCommandRaw['VALUE3']) . '\');';
}
break;
case 'OBJECT_ADD_TAG':
if ($queuedCommandRaw['TEXT']) {
$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addTag(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\', ' . stripslashes($queuedCommandRaw['VALUE5']) . ', \'' . $queuedCommandRaw['VALUE6'] . '\', \'' . $queuedCommandRaw['VALUE7'] . '\');';
}
break;
case 'OBJECT_DELETE':
if ($queuedCommandRaw['TEXT']) {
$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_del(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\');';
}
break;
case 'ADD_FILE':
$file = new File($objectID);
$latestVersion = $file->getLatestApprovedVersion();
$file = new File($objectID, $latestVersion);
$fileInfo = $file->get();
$reftracker = new Reftracker();
if ($fileInfo['CREATEDBY']) {
$user = new User($fileInfo['CREATEDBY']);
$userInfo = $user->get();
$userInfo['PROPS'] = $user->properties->getValues($fileInfo['CREATEDBY']);
}
$fileInfo['CUSTOM_DATE'] = date('d.m.Y', TStoLocalTS($fileInfo['CHANGEDTS']));
$fileInfo['CUSTOM_TIME'] = date('G:i', TStoLocalTS($fileInfo['CHANGEDTS']));
$fileInfo['REFS'] = $reftracker->getIncomingForFile($fileInfo['OBJECTID']);
$tags = $file->tags->getAssigned();
for ($t = 0; $t < count($tags); $t++) {
$tp = array();
$tp = $file->tags->tree->getParents($tags[$t]['ID']);
$tp2 = array();
for ($p = 0; $p < count($tp); $p++) {
$tinfo = $file->tags->get($tp[$p]);
$tp2[$p]['ID'] = $tinfo['ID'];
$tp2[$p]['NAME'] = $tinfo['NAME'];
}
$tp2[count($tp2) - 1]['NAME'] = $itext['TXT_TAGS'] != '' ? $itext['TXT_TAGS'] : '$TXT_TAGS';
$tags[$t]['PARENTS'] = $tp2;
}
$fileInfo['TAGS'] = $tags;
$fileInfo['THUMB'] = 1;
if ($queuedCommandRaw['TEXT'] == 'nothumb') {
$fileInfo['THUMB'] = 0;
}
$views = $file->views->getAssigned();
foreach ($views as $view) {
if ($view["IDENTIFIER"] == "YGSOURCE") {
$viewinfo = $file->views->getGeneratedViewInfo($view["ID"]);
$fileInfo["WIDTH"] = $viewinfo[0]["WIDTH"];
$fileInfo["HEIGHT"] = $viewinfo[0]["HEIGHT"];
}
}
$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addFile(\'file\', \'' . $fileInfo['PARENT'] . '-file\', \'' . $objectID . '\', \'' . $fileInfo['THUMB'] . '\', \'' . $fileInfo['COLOR'] . '\', \'' . $fileInfo['CODE'] . '\', \'' . $fileInfo['NAME'] . '\', \'' . $fileInfo['PNAME'] . '\', \'' . json_encode($fileInfo['TAGS']) . '\', \'' . $fileInfo['FILESIZE'] . '\', \'' . count($fileInfo['REFS']) . '\', \'' . TStoLocalTS($fileInfo['CHANGEDTS']) . '\', \'' . $fileInfo['CUSTOM_DATE'] . '\', \'' . $fileInfo['CUSTOM_TIME'] . '\', \'' . $fileInfo['UID'] . '\', \'' . $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME'] . '\', \'' . $fileInfo['FILENAME'] . '\', \'' . $fileInfo["WIDTH"] . '\', \'' . $fileInfo['HEIGHT'] . '\');';
break;
case 'REFRESH_TAGS':
if ($queuedCommandRaw['TEXT']) {
switch ($queuedCommandRaw['TYPE']) {
case HISTORYTYPE_CO:
$objType = 'cblock';
break;
case HISTORYTYPE_FILE:
$objType = 'file';
示例4: array
$objectdynprops[$objectdynprops_cnt]['FILEABBREVIATION'] = $linkInfo['INFO']['CODE'];
$objectdynprops[$objectdynprops_cnt]['FILECOLOR'] = $linkInfo['INFO']['COLOR'];
$objectdynprops[$objectdynprops_cnt]['FILE_ID'] = $linkInfo['INFO']['FILE_ID'];
break;
}
}
}
}
$objectdynprops_cnt++;
}
}
break;
case 'tag':
$autosave = true;
$objectInfo = $tagMgr->get($object);
$objectparents = $tagMgr->getParents($object);
$objectparents[count($objectparents) - 1][0]['NAME'] = $itext['TXT_TAGS'] != '' ? $itext['TXT_TAGS'] : '$TXT_TAGS';
$object_permissions = array();
$object_permissions['RWRITE'] = $tagMgr->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RWRITE");
$objectdynprops = array(0 => array(0 => 'Name', 'NAME' => 'Name', 1 => 1, 'ID' => 1, 2 => 'NAME', 'IDENTIFIER' => 'NAME', 3 => 1, 'VISIBLE' => 1, 4 => 'TEXT', 'TYPE' => 'TEXT', 5 => $objectInfo['NAME'], 'VALUE' => $objectInfo['NAME']));
break;
}
if ($lockedFailed) {
// Get user who locked this object
$userWithLock = new User($lockStatus['LOCKUID']);
$lockedByUser = $userWithLock->get($lockStatus['LOCKUID']);
$lockedByUser['PROPS'] = $userWithLock->properties->getValues($lockStatus['LOCKUID']);
$smarty->assign('lockedByUser', $lockedByUser);
$object_permissions['RWRITE'] = false;
if ($objecttype == 'cblock' || $objecttype == 'page') {
$koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setStageButton( \'0\' );');