Lines Matching refs:params
24 function validateParameters(&$params) { argument
25 if (isset($params['align'])) {
26 if (!in_array($params['align'], array('left', 'center', 'right')))
27 $params['align'] = 'left';
30 if (isset($params['button'])) {
31 if (!in_array($params['button'], array('normal', 'compact', 'static')))
32 $params['button'] = 'normal';
35 if (isset($params['category'])) {
36 … if (!in_array($params['category'], array('text', 'images', 'video', 'audio', 'software', 'rest')))
37 $params['category'] = $this->getConf('default_category');
40 if (isset($params['uid'])) {
41 if (preg_match('#^[0-9a-z]+$#', $params['uid']) != 1)
42 unset($params['uid']);
45 if (isset($params['thing'])) {
46 if (preg_match('#^[0-9]+$#', $params['thing']) != 1)
47 unset($params['thing']);
51 function insertMissingParameters(&$params, $title=false, $description=false, $tag=false) { argument
56 $params = array_merge($params, array_filter(compact('title', 'description', 'tag')));
59 if (!isset($params[$p])) {
63 $params['uid'] = $this->getConf('default_uid');
69 $params['category'] = $this->getConf('default_category');
74 $params['title'] = tpl_pagetitle($INFO['id'], true);
78 $params['description'] = $meta['description']['abstract'];
83 $params['language'] = $this->getConf('default_language');
88 $params['url'] = wl($INFO['id'], '', true);
92 $params['align'] = 'left';
98 $params['tag'] = implode(',', $tags);
106 function getEmbedCode($params) { argument
107 if (!isset($params['align']))
110 $code = '<div class="flattr_'.$this->_xmlEntities($params['align']).'">';
111 switch ($params['button']) {
113 $code .= $this->getStaticEmbedCode($params);
116 $code .= $this->getJsEmbedCode($params);
124 function getJsEmbedCode($params) { argument
133 if (isset($params[$to])) {
134 $rev_params[$to] = $params[$to];
135 } elseif (isset($params[$from])) {
136 $rev_params[$to] = $params[$from];
142 $failed = array_diff($mandatories, array_keys($params));
149 $code .= 'title="'.hsc($params['title']).'" ';
150 $code .= 'href="'.hsc($params['url']).'" ';
156 $code .= str_replace("\n", "<br />", hsc($params['description']));
162 function getStaticEmbedCode($params) { argument
163 if (!isset($params['thing'])) {
174 function tpl_flattrbtn($params = array(), $ret = false) { argument
175 $this->insertMissingParameters($params);
176 $btn = $this->getEmbedCode($params);