Esempio n. 1
0
/**
 * @access private
 */
function cms_module_CreateLink(&$modinstance, $id, $action, $returnid = '', $contents = '', $params = array(), $warn_message = '', $onlyhref = false, $inline = false, $addttext = '', $targetcontentonly = false, $prettyurl = '')
{
    if (!is_array($params) && $params == '') {
        $params = array();
    }
    $id = cms_htmlentities($id);
    $action = cms_htmlentities($action);
    $returnid = cms_htmlentities($returnid);
    $prettyurl = cms_htmlentities($prettyurl);
    $gCms = cmsms();
    $config = $gCms->GetConfig();
    $class = isset($params['class']) ? cms_htmlentities($params['class']) : '';
    // create url....
    $text = cms_module_create_url($modinstance, $id, $action, $returnid, $params, $inline, $targetcontentonly, $prettyurl);
    if (!$onlyhref) {
        $beginning = '<a';
        if ($class != '') {
            $beginning .= ' class="' . $class . '"';
        }
        $beginning .= ' href="';
        $text = $beginning . $text . "\"";
        if ($warn_message != '') {
            $text .= ' onclick="return confirm(\'' . $warn_message . '\');"';
        }
        if ($addttext != '') {
            $text .= ' ' . $addttext;
        }
        $text .= '>' . $contents . '</a>';
    }
    return $text;
}
Esempio n. 2
0
 /**
  * Returns a URL to a module action
  * This method is called by the CreateLink methods when creating a link to a module action.
  *
  * @since 1.10
  * @param string The module action id (cntnt01 indicates that the defaul content block of the destination page should be used).
  * @param string The module action name
  * @param integer The destination page.
  * @param hash   Areay of parameters for the URL.  These will be ignored if the prettyurl argument is specified.
  * @param boolean Wether the target of the output link is the same tag on the same page.
  * @param boolean Wether the target of the output link targets the content area of the destination page.
  * @param string  An optional url segment related to the root of the page for pretty url purposes.
  * @return string.
  */
 public function create_url($id, $action, $returnid = '', $params = array(), $inline = false, $targetcontentonly = false, $prettyurl = '')
 {
     $this->LoadFormMethods();
     return cms_module_create_url($this, $id, $action, $returnid, $params, $inline, $targetcontentonly, $prettyurl);
 }