/** * Method to generate the title of group on Save as Copy action * * @param integer $parentId The id of the parent. * @param string $title The title of group * * @return string Contains the modified title. * * @since 3.3.7 */ protected function generateGroupTitle($parentId, $title) { // Alter the title & alias $table = $this->getTable(); while ($table->load(array('title' => $title, 'parent_id' => $parentId))) { if ($title == $table->title) { $title = StringHelper::increment($title); } } return $title; }
/** * Method to change the title. * * @param integer $category_id The id of the category. * @param string $alias The alias. * @param string $title The title. * * @return string New title. * * @since 1.7.1 */ protected function generateNewTitle($category_id, $alias, $title) { // Alter the title $table = $this->getTable(); while ($table->load(array('title' => $title))) { $title = StringHelper::increment($title); } return $title; }
/** * Method to change the title & alias. * * @param integer $parent_id The id of the parent. * @param string $alias The alias. * @param string $title The title. * * @return array Contains the modified title and alias. * * @since 1.7 */ protected function generateNewTitle($parent_id, $alias, $title) { // Alter the title & alias $table = $this->getTable(); while ($table->load(array('alias' => $alias, 'parent_id' => $parent_id))) { $title = StringHelper::increment($title); $alias = StringHelper::increment($alias, 'dash'); } return array($title, $alias); }
/** * Method to change the title & alias. * * @param integer $category_id The id of the parent. * @param string $alias The alias. * @param string $name The title. * * @return array Contains the modified title and alias. * * @since 3.1 */ protected function generateNewTitle($category_id, $alias, $name) { // Alter the title & alias $table = $this->getTable(); while ($table->load(array('alias' => $alias, 'catid' => $category_id))) { if ($name == $table->name) { $name = StringHelper::increment($name); } $alias = StringHelper::increment($alias, 'dash'); } return array($name, $alias); }
/** * Method to change the title. * * @param integer $category_id The id of the category. Not used here. * @param string $title The title. * @param string $position The position. * * @return array Contains the modified title. * * @since 2.5 */ protected function generateNewTitle($category_id, $title, $position) { // Alter the title & alias $table = $this->getTable(); while ($table->load(array('position' => $position, 'title' => $title))) { $title = StringHelper::increment($title); } return array($title); }
/** * Method to change the name & alias if alias is already in use * * @param string $alias The alias. * @param string $name The name. * @param integer $categoryId Category identifier * * @return array Contains the modified title and alias. * * @since 3.2.3 */ protected function generateAliasAndName($alias, $name, $categoryId) { $table = $this->getContactTable(); while ($table->load(array('alias' => $alias, 'catid' => $categoryId))) { if ($name == $table->name) { $name = StringHelper::increment($name); } $alias = StringHelper::increment($alias, 'dash'); } return array($name, $alias); }