public static function ipPagePropertiesForm($form, $data) { $fieldset = new \Ip\Form\Fieldset(__('Glori options', 'Glori')); $fieldset->addField(new Field\BreadCrumb(array('name' => 'magellan_original_page', 'label' => __('Original page', 'Glori'), 'value' => ipPageStorage($data['pageId'])->get('magellan_original_page', null), 'note' => __('Target page with content.', 'Glori')))); $fieldset->addField(new \Ip\Form\Field\Text(array('name' => 'magellan_anchor', 'label' => __('Anchor', 'Glori'), 'value' => ipPageStorage($data['pageId'])->get('magellan_anchor', ''), 'note' => __('Anchor marking the start of content in page. Add exact anchor to heading widget(in options) or in background widget(options) in Original page marking start of the content', 'Glori')))); $form->addFieldset($fieldset); return $form; }
/** * @param \Ip\Form $form * @return mixed */ public static function ipPagePropertiesForm($form, $info) { $value = ipPageStorage($info['pageId'])->get('PagePassword'); $fieldset = new \Ip\Form\Fieldset(__('Password', 'PagePassword', false)); $form->addFieldset($fieldset); $form->addField(new \Ip\Form\Field\Text(array('name' => 'pagePassword', 'label' => __('Password', 'PagePassword', false), 'note' => __('Set password to protect page from guest visitors.', 'PagePassword', false), 'value' => $value))); return $form; }
public static function unbindImages($pageId) { $curFiles = self::getPageImages($pageId); foreach ($curFiles as $file) { ipUnbindFile($file, self::PLUGIN, $pageId); } ipPageStorage($pageId)->remove('pageImage'); }
/** * @param \Ip\Form $form * @return mixed */ public static function ipPagePropertiesForm($form, $info) { $values = array(); $current = ipPageStorage($info['pageId'])->get('rssFeed'); $fieldset = new \Ip\Form\Fieldset(__('RSS', 'rssFeed', false)); $form->addFieldset($fieldset); $form->addField(new \Ip\Form\Field\Checkbox(array('name' => 'rssFeed', 'label' => 'Add to RSS feed', 'value' => $current))); return $form; }
public static function updateRssCheckbox($pageId, $isEnabled) { if ($isEnabled == "on" || $isEnabled == 1) { $value = 1; } else { $value = 0; } ipPageStorage($pageId)->set('rssFeed', $value); }
public static function ipPageUpdated($data) { $pageId = isset($data['pageId']) ? $data['pageId'] : $data['id']; if (isset($data['magellan_anchor'])) { ipPageStorage($pageId)->set('magellan_anchor', $data['magellan_anchor']); } if (isset($data['magellan_original_page'])) { ipPageStorage($pageId)->set('magellan_original_page', $data['magellan_original_page']); } }
public static function unbindImages($pageId) { $facebookTags = self::getFacebookTags($pageId); if (empty($facebookTags['images']) || !is_array($facebookTags['images'])) { return; } foreach ($facebookTags['images'] as $file) { ipUnbindFile($file, self::PLUGIN, $pageId); } ipPageStorage($pageId)->remove('facebookTagImage'); }
/** * @param \Ip\Form $form * @return mixed */ public static function ipPagePropertiesForm($form, $info) { $values = array(); $current = ipPageStorage($info['pageId'])->get('PageImage'); if (is_array($current)) { foreach ($current as $item) { if (is_string($item)) { $values[] = $item; } } } $fieldset = new \Ip\Form\Fieldset(__('Images', 'PageImage', false)); $form->addFieldset($fieldset); $form->addField(new \Ip\Form\Field\RepositoryFile(array('name' => 'pageImage', 'label' => '', 'preview' => 'thumbnails', 'value' => $values))); return $form; }
/** * We assume page is safe to delete. * * @param int $pageId * @return int Count of deleted pages. */ protected static function _removeDeletedPage($pageId) { $deletedPageCount = 0; $children = ipDb()->selectAll('page', array('id', 'isDeleted'), array('parentId' => $pageId)); foreach ($children as $child) { if ($child['isDeleted']) { $deletedPageCount += static::_removeDeletedPage($child['id']); } else { // This should never happen! ipLog()->error('Page.pageHasDeletedParent: page {pageId}, parent set to null', array('pageId' => $child['id'])); ipDb()->update('page', array('parentId' => null), array('id' => $child['id'])); } } ipEvent('ipBeforePageRemoved', array('pageId' => $pageId)); $count = ipDb()->delete('page', array('id' => $pageId)); ipPageStorage($pageId)->removeAll(); ipEvent('ipPageRemoved', array('pageId' => $pageId)); $deletedPageCount += (int) $count; return $deletedPageCount; }
public static function ipPageAdded($row) { ipPageStorage($row['id'])->set('asdBlog-date', date('Y-m-d', time())); ipPageStorage($row['id'])->set('asdBlog-time', date('H:i:s', time())); }
public static function updatePagePassword($pageId, $password) { ipPageStorage($pageId)->set('PagePassword', $password); }
$magellan = ''; if ($menuItem->isCurrent()) { $css[] = $active; $css[] = 'original'; } elseif ($menuItem->isInCurrentBreadcrumb()) { $css[] = $crumb; } if (sizeof($menuItem->getChildren()) > 0) { $css[] = $parent; } if ($menuItem->isDisabled()) { $href = ''; $css[] = $disabled; } else { $magellan_original_page = ipContent()->getPage(ipPageStorage($menuItem->getId())->get('magellan_original_page', 0)); $magellan_anchor = ipPageStorage($menuItem->getId())->get('magellan_anchor', null); if ($magellan_original_page && $magellan_anchor) { if ($magellan_original_page->isCurrent()) { $href = ' href="' . escAttr('#' . $magellan_anchor) . '"'; $magellan = 'data-magellan-arrival="' . trim($magellan_anchor) . '"'; } else { $href = ' href="' . $magellan_original_page->getLink() . '#' . trim($magellan_anchor) . '"'; } } else { if ($menuItem->isCurrent()) { $href = ' href="#top"'; $magellan = 'data-magellan-arrival="top"'; } else { $href = ' href="' . escAttr($menuItem->getUrl()) . '"'; } }