public function getHelpDocument()
 {
     $oldPath = craft()->path->getTemplatesPath();
     $newPath = craft()->path->getPluginsPath() . 'usermanual/templates/';
     $template = '_body.html';
     $settings = craft()->plugins->getPlugin('usermanual')->getSettings();
     $segments = craft()->request->segments;
     $segment = end($segments);
     $sectionId = $settings->section;
     $criteria = craft()->elements->getCriteria(ElementType::Entry);
     $criteria->sectionId = $sectionId;
     $criteria->slug = $segment;
     if (!$criteria->total()) {
         $criteria->slug = null;
     }
     $entry = $criteria->first();
     // If the app has not been set up at all or there are no entires, redirect to the settings page
     if (!$sectionId || !$entry) {
         craft()->request->redirect(UrlHelper::getCpUrl('settings/plugins/usermanual/'));
     } else {
         if ($settings->templateOverride) {
             $newPath = craft()->path->getSiteTemplatesPath();
             $template = $settings->templateOverride;
         }
         craft()->path->setTemplatesPath($newPath);
         $output = craft()->templates->render($template, ['entry' => $entry]);
         craft()->path->setTemplatesPath($oldPath);
         return $output;
     }
 }
 public function getHelpDocument($path = '')
 {
     $segments = craft()->request->segments;
     $segment = end($segments);
     $section = craft()->userManual_settings->getChannelSetting();
     $criteria = craft()->elements->getCriteria(ElementType::Entry);
     $criteria->section = $section;
     $criteria->slug = $segment;
     $entry = $criteria->find();
     // if the app has not been set up at all, redirect to the settings page
     if ($section == '') {
         craft()->request->redirect(UrlHelper::getCpUrl('settings/plugins/usermanual/'));
     } else {
         if (!$entry) {
             $firstCriteria = craft()->elements->getCriteria(ElementType::Entry);
             $firstCriteria->section = $section;
             $firstCriteria->limit = 1;
             $firstEntry = $firstCriteria->find();
             echo $firstEntry[0]['body'];
         } else {
             echo $entry[0]['body'];
         }
     }
 }
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/settings/orderstatuses/' . $this->id);
 }
 /**
  * @inheritdoc
  * @return string
  */
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/orders/' . $this->id);
 }
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/products/' . $this->product->type->handle . '/' . $this->product->id . '/variants/' . $this->id);
 }
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/settings/taxzones/' . $this->id);
 }
Exemplo n.º 7
0
 public function onAfterInstall()
 {
     craft()->request->redirect(UrlHelper::getCpUrl('settings/plugins/moltin'));
 }
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/settings/ordersettings');
 }
Exemplo n.º 9
0
<?php

return [['name' => 'Manage Orders', 'type' => 'Link', 'url' => \Craft\UrlHelper::getCpUrl('market/orders')], ['name' => 'Manage Products', 'type' => 'Link', 'url' => \Craft\UrlHelper::getCpUrl('market/products')]];
 public function getCpEditUrl()
 {
     return UrlHelper::getCpUrl('market/customers/' . $this->customerId . '/addresses/' . $this->id);
 }
 public function block_foot($context, array $blocks = array())
 {
     // line 37
     echo "\t<noscript>\n\t\t<div class=\"message-container no-access\">\n\t\t\t<div class=\"pane notice\">\n\t\t\t\t<p>";
     // line 40
     echo twig_escape_filter($this->env, \Craft\Craft::t("JavaScript must be enabled to access the Craft control panel."), "html", null, true);
     echo "</p>\n\t\t\t</div>\n\t\t</div>\n\t</noscript>\n\n\t<script type=\"text/javascript\">\n\t\twindow.Craft = {\n\t\t\tsiteUid:              \"";
     // line 47
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "app"), "getSiteUid", array(), "method"), "js"), "html", null, true);
     echo "\",\n\t\t\tbaseUrl:              \"";
     // line 48
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, \Craft\UrlHelper::getUrl(), "js"), "html", null, true);
     echo "\",\n\t\t\tbaseCpUrl:            \"";
     // line 49
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, \Craft\UrlHelper::getCpUrl(), "js"), "html", null, true);
     echo "\",\n\t\t\tbaseSiteUrl:          \"";
     // line 50
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, \Craft\UrlHelper::getSiteUrl(), "js"), "html", null, true);
     echo "\",\n\t\t\tactionUrl:            \"";
     // line 51
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, \Craft\UrlHelper::getActionUrl(), "js"), "html", null, true);
     echo "\",\n\t\t\tresourceUrl:          \"";
     // line 52
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, \Craft\UrlHelper::getResourceUrl(), "js"), "html", null, true);
     echo "\",\n\t\t\tscriptName:           \"";
     // line 53
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "request"), "getScriptName", array(), "method"), "js"), "html", null, true);
     echo "\",\n\t\t\tomitScriptNameInUrls: ";
     // line 54
     echo $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "config"), "omitScriptNameInUrls", array(), "method") ? "true" : "false";
     echo ",\n\t\t\tusePathInfo:          ";
     // line 55
     echo $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "config"), "usePathInfo", array(), "method") ? "true" : "false";
     echo ",\n\t\t\tresourceTrigger:      \"";
     // line 56
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "config"), "getResourceTrigger", array(), "method"), "js"), "html", null, true);
     echo "\",\n\t\t\tactionTrigger:        \"";
     // line 57
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "config"), "actionTrigger"), "js"), "html", null, true);
     echo "\",\n\t\t\tpath:                 \"";
     // line 58
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "request"), "getPath", array(), "method"), "js"), "html", null, true);
     echo "\",\n\t\t\tlocale:               \"";
     // line 59
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "craft"), "locale"), "js"), "html", null, true);
     echo "\",\n\t\t\torientation:          \"";
     // line 60
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getContext($context, "orientation"), "js"), "html", null, true);
     echo "\",\n\t\t\tleft:                 \"";
     // line 61
     echo $this->getContext($context, "orientation") == "ltr" ? "left" : "right";
     echo "\",\n\t\t\tright:                \"";
     // line 62
     echo $this->getContext($context, "orientation") == "ltr" ? "right" : "left";
     echo "\",\n\t\t\tPersonal:             ";
     // line 63
     echo twig_escape_filter($this->env, $this->getContext($context, "CraftPersonal"), "html", null, true);
     echo ",\n\t\t\tClient:               ";
     // line 64
     echo twig_escape_filter($this->env, $this->getContext($context, "CraftClient"), "html", null, true);
     echo ",\n\t\t\tPro:                  ";
     // line 65
     echo twig_escape_filter($this->env, $this->getContext($context, "CraftPro"), "html", null, true);
     echo ",\n\t\t\tedition:              ";
     // line 66
     echo twig_escape_filter($this->env, $this->getContext($context, "CraftEdition"), "html", null, true);
     echo ",\n\t\t\tisLocalized:          ";
     // line 67
     echo $this->getAttribute($this->getContext($context, "craft"), "isLocalized", array(), "method") ? "true" : "false";
     echo ",\n\t\t\ttranslations:         ";
     // line 68
     echo \Craft\craft()->templates->getTranslations();
     echo ",\n\t\t\tmaxUploadSize:        ";
     // line 69
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "app"), "getMaxUploadSize", array(), "method"), "html", null, true);
     echo ",\n\t\t\tslugWordSeparator:    \"";
     // line 70
     echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "config"), "slugWordSeparator"), "js"), "html", null, true);
     echo "\"\n\t\t};\n\n\t\twindow.Craft.fileKinds = {};\n\t\t";
     // line 74
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getContext($context, "craft"), "app"), "getFileKinds", array(), "method"));
     foreach ($context['_seq'] as $context["kind"] => $context["info"]) {
         // line 75
         echo "\t\t\twindow.Craft.fileKinds.";
         echo twig_escape_filter($this->env, $this->getContext($context, "kind"), "html", null, true);
         echo " = [];\n\t\t\t";
         // line 76
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "info"), "extensions"));
         foreach ($context['_seq'] as $context["_key"] => $context["extension"]) {
             // line 77
             echo "\t\t\t\twindow.Craft.fileKinds.";
             echo twig_escape_filter($this->env, $this->getContext($context, "kind"), "html", null, true);
             echo ".push(\"";
             echo twig_escape_filter($this->env, $this->getContext($context, "extension"), "html", null, true);
             echo "\");\n\t\t\t";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['extension'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 79
         echo "\t\t";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['kind'], $context['info'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 80
     echo "\t</script>\n";
 }
 /**
  * @return null|string
  */
 public function getCpEditUrl()
 {
     if ($this->typeId) {
         $productTypeHandle = craft()->market_productType->getById($this->typeId)->handle;
         return UrlHelper::getCpUrl('market/products/' . $productTypeHandle . '/' . $this->id);
     }
     return null;
 }