本文整理汇总了PHP中umiHierarchy::convertAltName方法的典型用法代码示例。如果您正苦于以下问题:PHP umiHierarchy::convertAltName方法的具体用法?PHP umiHierarchy::convertAltName怎么用?PHP umiHierarchy::convertAltName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umiHierarchy
的用法示例。
在下文中一共展示了umiHierarchy::convertAltName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setName
public function setName($vb068931cc450442b63f5b3d276ea4297)
{
$vb068931cc450442b63f5b3d276ea4297 = umiHierarchy::convertAltName($vb068931cc450442b63f5b3d276ea4297, "_");
$this->name = umiObjectProperty::filterInputString($vb068931cc450442b63f5b3d276ea4297);
if (!strlen($this->name)) {
$this->name = '_';
}
$this->setIsUpdated();
}
示例2: setAltName
public function setAltName($vd84ff935144e00c3e1d395c2379aca47, $v5c42c04954c401e189bb85786bde8adb = true)
{
if (!$vd84ff935144e00c3e1d395c2379aca47) {
$vd84ff935144e00c3e1d395c2379aca47 = $this->getName();
}
if ($v5c42c04954c401e189bb85786bde8adb) {
$vd84ff935144e00c3e1d395c2379aca47 = umiHierarchy::convertAltName($vd84ff935144e00c3e1d395c2379aca47);
if (!$vd84ff935144e00c3e1d395c2379aca47) {
$vd84ff935144e00c3e1d395c2379aca47 = "_";
}
}
$vd295b8117d72bf06e54a27bcbfc782cf = $this->alt_name;
$this->alt_name = $this->getRightAltName(umiObjectProperty::filterInputString($vd84ff935144e00c3e1d395c2379aca47));
if (!$this->alt_name) {
$this->alt_name = $vd84ff935144e00c3e1d395c2379aca47;
}
$v1988c61c48f30d2b39eed4edcf1e3c8b = $this->alt_name;
if ($v1988c61c48f30d2b39eed4edcf1e3c8b !== $vd295b8117d72bf06e54a27bcbfc782cf) {
$this->setIsUpdated();
}
}
示例3: copy_to_lang_old
public function copy_to_lang_old()
{
$langId = (int) getRequest('lang-id');
$domainId = (int) getRequest('domain-id');
$alias_new = (array) getRequest('alias');
$move_old = (array) getRequest('move');
$force = (int) getRequest('force');
$mode = (string) getRequest('mode');
$elements = getRequest('element');
if (!is_array($elements)) {
$elements = array($elements);
}
foreach ($alias_new as $k => $v) {
$alias_new[$k] = umiHierarchy::convertAltName($v);
}
if (!is_null($langId)) {
$hierarchy = umiHierarchy::getInstance();
if (!$force) {
$aliases_old = array();
foreach ($elements as $elementId) {
if (!empty($move_old[$elementId])) {
continue;
}
$element = $this->expectElement($elementId, false, true);
$alt_name = $element->getAltName();
if (!empty($alias_new[$element->getId()])) {
$alt_name = $alias_new[$element->getId()];
}
$errors = array();
$element_dst = umiHierarchy::getInstance()->getIdByPath($alt_name, false, $errors, $domainId, $langId);
$element_dst = $this->expectElement($element_dst, false, true);
if ($element_dst && $element_dst->getAltName() == $alt_name) {
$alt_name_normal = $hierarchy->getRightAltName($alt_name, $element_dst, false, true);
$aliases_old[$element->getId()] = array($alt_name, $alt_name_normal);
}
}
if (count($aliases_old)) {
$this->setDataType("list");
$this->setActionType("view");
$data = array('error' => array());
//$this->prepareData(array(), "pages");
$data['error']['nodes:item'] = array();
$data['error']['type'] = '__alias__';
$path = "http://" . domainsCollection::getInstance()->getDomain($domainId)->getHost() . "/";
if (!langsCollection::getInstance()->getLang($langId)->getIsDefault()) {
$path .= langsCollection::getInstance()->getLang($langId)->getPrefix() . '/';
}
foreach ($aliases_old as $k => $v) {
$data['error']['nodes:item'][] = array('attribute:id' => $k, 'attribute:path' => $path, 'attribute:alias' => $v[0], 'attribute:alt_name_normal' => $v[1]);
}
$this->setData($data);
return $this->doData();
}
}
$templatesCollection = templatescollection::getInstance();
$templates = $templatesCollection->getTemplatesList($domainId, $langId);
$template_error = false;
if (empty($templates)) {
$template_error = true;
}
if ($template_error) {
$this->setDataType("list");
$this->setActionType("view");
$data = $this->prepareData(array(), "pages");
$dstLang = langsCollection::getInstance()->getLang($langId);
$lang = '';
if (!$dstLang->getIsDefault()) {
$lang .= $dstLang->getPrefix() . '/';
}
$data['error'] = array();
$data['error']['type'] = "__template_not_exists__";
$data['error']['text'] = sprintf(getLabel('error-no-template-in-domain'), $lang);
$this->setData($data);
return $this->doData();
}
$template_def = $templatesCollection->getDefaultTemplate($domainId, $langId);
foreach ($elements as $elementId) {
$element = $this->expectElement($elementId, false, true);
$element_template = $templatesCollection->getTemplate($element->getTplId());
$template_has = false;
foreach ($templates as $v) {
if ($v->getFilename() == $element_template->getFilename()) {
$template_has = $v;
}
}
if (!$template_has) {
$template_has = $template_def;
}
if (!$template_has) {
$template_has = reset($templates);
}
//if($element->getLangId() != $langId || true) {
if ($mode == 'move') {
$copyElement = $element;
$copyElementId = $element->getId();
} else {
$copyChilds = (bool) getRequest('copy_all');
$copyElementId = $hierarchy->cloneElement($element->getId(), 0, true, false);
$copyElement = $hierarchy->getElement($copyElementId);
}
//.........这里部分代码省略.........
示例4: translateName
protected static function translateName($vb068931cc450442b63f5b3d276ea4297)
{
$vb068931cc450442b63f5b3d276ea4297 = umiHierarchy::convertAltName($vb068931cc450442b63f5b3d276ea4297, "_");
$vb068931cc450442b63f5b3d276ea4297 = umiObjectProperty::filterInputString($vb068931cc450442b63f5b3d276ea4297);
if (!strlen($vb068931cc450442b63f5b3d276ea4297)) {
$vb068931cc450442b63f5b3d276ea4297 = '_';
}
$vb068931cc450442b63f5b3d276ea4297 = substr($vb068931cc450442b63f5b3d276ea4297, 0, 64);
return $vb068931cc450442b63f5b3d276ea4297;
}