Template object for list records counter.

@param array Object attributes

@return string HTML output
199297
function tpl_keys_rowcount($attrib)
    {
        if (!$attrib['id'])
            $attrib['id'] = 'rcmcountdisplay';

        $this->rc->output->add_gui_object('countdisplay', $attrib['id']);

        return html::span($attrib, $this->get_rowcount_text());
    }
77857
public function widget(array $attributes = [])
    {
        $string = '<thead><tr>';
        foreach ($this->collection as $collectedItem) {
            $columnAttributes          = array_only($collectedItem->toArray(), ['class', 'id', 'width', 'style', 'data-class', 'data-hide']);
            $columnAttributes['class'] = (isset($collectedItem->bolded) and $collectedItem->bolded === true) ? 'bolded' : array_get($columnAttributes, 'class', '');
            $params                    = $this->html->attributes($columnAttributes);
            $string                    .= "<th " . $params . ">{$collectedItem->title}</th>";
        }
        $string .= '</tr></thead>';
        $string .= '<tbody>';
        foreach ($this->getDeferredDataItems() as $item) {
            $string .= '<tr>';
            foreach ($this->collection as $collectedItem) {
                $value  = isset($item->{$collectedItem->data}) ? $item->{$collectedItem->data} : '---';
                $string .= "<td>{$value}</td>";
            }
            $string .= '</tr>';
        }
        $string                .= '</tbody>';
        $this->tableAttributes = array_merge($this->tableAttributes, $attributes);
        $scrollable            = '';
        if ($this->datatable->count() > 10 or strlen($this->ajax) > 0) {
            $scrollable = 'data-scrollable';
        }
        $massable = (int) $this->hasMassActions();
        $attrs    = $this->html->attributes($this->containerAttributes);

        return view('datatables-helpers::widget', ['attributes' => $attrs, 'table' => $this->beforeTable() . '<table data-massable="' . $massable . '" ' . $scrollable . ' data-table-init = "true" ' . $this->html->attributes($this->tableAttributes) . '>' . $string . '</table>']);
    }
786265
public function render($count = 0)
    {
        $pagination = "";
        $items = $this->navigation($count);
        if ($items) foreach ($items as $page) {
            $pagination .= $this->item($page['page'], $page['url'], $page['label'], $page['class'], $page['current'], false);
        }
        
        $listPropertiesHtml = "";
        foreach ($this->options['list_properties'] as $k => $v) {
            $listPropertiesHtml .= " $k=\"$v\"";
        }
        $html = "<{$this->options['list_tag']}$listPropertiesHtml>{$pagination}</{$this->options['list_tag']}>";
        
        if ($this->options['container_tag']) {
            $containerPropertiesHtml = "";
            foreach ($this->options['container_properties'] as $k => $v) {
                $containerPropertiesHtml .= " $k=\"$v\"";
            }
            $html = "<div$containerPropertiesHtml>
                    $html
                    </div>";
        }
        
        return $html;
    }
788014
public function attributes()
	{
		if (!is_array($this->attrs)) {
			return '';
		}

		$s = '';
		$attrs = $this->attrs;

		foreach ($attrs as $key => $value) {
			if ($value === NULL || $value === FALSE) {
				continue;

			} elseif ($value === TRUE) {
				if (static::$xhtml) {
					$s .= ' ' . $key . '="' . $key . '"';
				} else {
					$s .= ' ' . $key;
				}
				continue;

			} elseif (is_array($value)) {
				if (strncmp($key, 'data-', 5) === 0) {
					$value = json_encode($value);

				} else {
					$tmp = NULL;
					foreach ($value as $k => $v) {
						if ($v != NULL) { // intentionally ==, skip NULLs & empty string
							//  composite 'style' vs. 'others'
							$tmp[] = $v === TRUE ? $k : (is_string($k) ? $k . ':' . $v : $v);
						}
					}
					if ($tmp === NULL) {
						continue;
					}

					$value = implode($key === 'style' || !strncmp($key, 'on', 2) ? ';' : ' ', $tmp);
				}

			} elseif (is_float($value)) {
				$value = rtrim(rtrim(number_format($value, 10, '.', ''), '0'), '.');

			} else {
				$value = (string)$value;
			}

			$q = strpos($value, '"') === FALSE ? '"' : "'";
			$s .= ' ' . $key . '=' . $q
				. str_replace(
					['&', $q, '<'],
					['&amp;', $q === '"' ? '&quot;' : '&#39;', self::$xhtml ? '&lt;' : '<'],
					$value
				)
				. (strpos($value, '`') !== FALSE && strpbrk($value, ' <>"\'') === FALSE ? ' ' : '')
				. $q;
		}

		$s = str_replace('@', '&#64;', $s);

		return $s;
	}
467683
public function dl(array $list, array $attributes = [])
    {
        $attributes = $this->attributes($attributes);

        $html = "<dl{$attributes}>";

        foreach ($list as $key => $value) {
            $value = (array) $value;

            $html .= "<dt>$key</dt>";

            foreach ($value as $v_key => $v_value) {
                $html .= "<dd>$v_value</dd>";
            }
        }

        $html .= '</dl>';

        return $this->toHtmlString($html);
    }
848758
public function formatAttributes()
    {
        $html = [];
        foreach ((array) $this->getAttributes() as $key => $value) {
            $element = $this->attributeElement($key, $value);
            if (!is_null($element)) {
                $html[] = $element;
            }
        }

        return count($html) > 0 ? ' '.implode(' ', $html) : '';
    }
258700
protected function definition_list(array $items, array $attributes = array()) {
        $output = html_writer::start_tag('dl', $attributes);
        foreach ($items as $label => $value) {
            $output .= html_writer::tag('dt', $label);
            $output .= html_writer::tag('dd', $value);
        }
        $output .= html_writer::end_tag('dl');
        return $output;
    }
1158428
public static function list_templates_parameters() {
        $sort = new external_value(
            PARAM_ALPHANUMEXT,
            'Column to sort by.',
            VALUE_DEFAULT,
            ''
        );
        $order = new external_value(
            PARAM_ALPHA,
            'Sort direction. Should be either ASC or DESC',
            VALUE_DEFAULT,
            ''
        );
        $skip = new external_value(
            PARAM_INT,
            'Skip this number of records before returning results',
            VALUE_DEFAULT,
            0
        );
        $limit = new external_value(
            PARAM_INT,
            'Return this number of records at most.',
            VALUE_DEFAULT,
            0
        );
        $includes = new external_value(
            PARAM_ALPHA,
            'What other contexts to fetch the templates from. (children, parents, self)',
            VALUE_DEFAULT,
            'children'
        );
        $onlyvisible = new external_value(
            PARAM_BOOL,
            'If should list only visible templates',
            VALUE_DEFAULT,
            false
        );

        $params = array(
            'sort' => $sort,
            'order' => $order,
            'skip' => $skip,
            'limit' => $limit,
            'context' => self::get_context_parameters(),
            'includes' => $includes,
            'onlyvisible' => $onlyvisible
        );
        return new external_function_parameters($params);
    }
1141423
private function formatRecords(array $entry)
    {
        $entries = str_split($entry['formatted'], self::EVENT_SIZE_LIMIT);
        $timestamp = $entry['datetime']->format('U.u') * 1000;
        $records = [];

        foreach ($entries as $entry) {
            $records[] = [
                'message' => $entry,
                'timestamp' => $timestamp
            ];
        }

        return $records;
    }
1275196
public function display()
    {
        if (!$this->visible) {
            return;
        }

        if ($this->model === null) {
            return;
        }

        parent::display();

        $show_no_records = true;
        $row_count = count($this->model);
        foreach ($this->extra_rows as $row) {
            if ($row->getVisibleByCount($row_count)) {
                $show_no_records = false;
                break;
            }
        }

        if ($row_count === 0 && $show_no_records) {
            if ($this->no_records_message != '') {
                $div = new SwatHtmlTag('div');
                $div->class = 'swat-none';
                $div->setContent(
                    $this->no_records_message,
                    $this->no_records_message_type
                );

                $div->display();
            }

            return;
        }

        $table_tag = new SwatHtmlTag('table');
        $table_tag->id = $this->id;
        $table_tag->class = $this->getCSSClassString();
        $table_tag->cellspacing = '0';

        $table_tag->open();

        if ($this->hasHeader()) {
            $this->displayHeader();
        }

        if ($this->use_invalid_tfoot_ordering) {
            $this->displayBody();
            $this->displayFooter();
        } else {
            $this->displayFooter();
            $this->displayBody();
        }

        $table_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
606872
public function store($attributes = [])
    {
        // Set the attributes
        $attributes = (!empty($attributes))? $attributes : $this->app->request->input();

        // Create the record
        $result = $this->model->create($attributes);

        // Return results
        return [
            'success' => true,
            'id' => $result['id'],
            'data' => $result
        ];
    }
62613
private function page_table_list(){
		$table_defs_all = $this->exdb->get_table_definition_all();
		// var_dump($table_defs_all);
		$table_list = array();
		foreach( $table_defs_all->tables as $table_def ){
			// var_dump($table_def);
			$table = array();
			$table['label'] = $table_def->label;
			$table['name'] = $table_def->name;
			$table['href'] = $this->generate_url($table_def->name);
			array_push($table_list, $table);
		}
		$rtn = $this->render(
			'form_table_list.html',
			array(
				'table_list'=>$table_list,
			)
		);
		// var_dump($table_list);
		$rtn = $this->wrap_theme($rtn);
		return $rtn;
	}
795570
protected function listifyAttr($array) {
        ksort($array);
        $list = array();
        foreach ($array as $name => $obj) {
            if ($obj === false) continue;
            $list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
        }
        return $this->listify($list);
    }
195653
public function getRelatedObjectsCount()
    {
        // Not an easy task to fetch published objects with API and take care of current_version, status
        // and attribute version, so just use SQL to fetch the object count in one go
        $tagID = (int) $this->attribute( 'id' );

        $db = eZDB::instance();
        $result = $db->arrayQuery( "SELECT COUNT(DISTINCT o.id) AS count FROM eztags_attribute_link l
                                   INNER JOIN ezcontentobject o ON l.object_id = o.id
                                   AND l.objectattribute_version = o.current_version
                                   AND o.status = " . eZContentObject::STATUS_PUBLISHED . "
                                   WHERE l.keyword_id = $tagID" );

        if ( is_array( $result ) && !empty( $result ) )
            return (int) $result[0]['count'];

        return 0;
    }
436987
public function count($params = [])
    {
        $this->setSelect('COUNT(*) AS ' . $this->quoteColumnName('total'))
            ->setLimit(-1);
        $record = $this->getDb()
            ->createCommand()
            ->setText($this->buildSql())
            ->queryRow(array_merge($this->getParams(), $params));
        return $record['total'];
    }
141950
private function createList($arrayMenu = '', $id = '', $class = '', $attributes = '')
    {
        if ($arrayMenu == '') $arrayMenu = $this->dataMenu;
        $remove = array('geen', 'Geen');

        $arrayKey = array_keys($arrayMenu);
        $arrayKey = array_diff($arrayKey, $remove);
        $arrayKey = array_values($arrayKey);
        $arrayCount = count($arrayKey);

        $this->output .= $this->ul('open', $id, $class, $attributes);
        if ($arrayCount > $this->aantalMenuItems) {
            $aantalExtraMenu = ceil($arrayCount / $this->aantalMenuItems);
            for ($x = 0; $x < $aantalExtraMenu; $x++) {
                $this->output .= $this->li('open');
                $this->output .= $this->a('full', '', 'extraMenu', '', '', '&lt; ' . ($x + 1) . ' &gt;');
                $this->output .= $this->ul('open', '', 'extraMenu');
                for ($y = $x * $this->aantalMenuItems; $y < $this->aantalMenuItems + ($this->aantalMenuItems * $x) && $y < $arrayCount; $y++) {
                    list ($_url, $_id, $_class, $_attrib) = $this->getURL($arrayMenu[$arrayKey[$y]], $arrayKey[$y]);
                    $this->output .= $this->li('open');
                    $this->output .= $this->a('full', $_id, $_class, $_attrib, $_url, $arrayKey[$y]);
                    $testArray = is_array($arrayMenu[$arrayKey[$y]]);
                    if ($testArray === TRUE) {
                        $arrayKeyChild = array_keys($arrayMenu[$arrayKey[$y]]);
                        $arrayKeyChild = array_diff($arrayKeyChild, $remove);
                        $arrayCountChild = count($arrayKeyChild);
                        if ($arrayCountChild > 0) {
                            $this->output .= $this->createList($arrayMenu[$arrayKey[$y]]);
                        }
                    }
                    $this->output .= $this->li('close');
                }
                $this->output .= $this->ul('close');
                $this->output .= $this->li('close');
            }
        } else {
            foreach ($arrayKey as $menuItem) {
                list ($_url, $_id, $_class, $_attrib) = $this->getURL($arrayMenu[$menuItem], $menuItem);
                $this->output .= $this->li('open');
                $this->output .= $this->a('full', $_id, $_class, $_attrib, $_url, $menuItem);
                $testArray = is_array($arrayMenu[$menuItem]);
                if ($testArray === TRUE) {
                    $arrayKeyChild = array_keys($arrayMenu[$menuItem]);
                    $arrayKeyChild = array_diff($arrayKeyChild, $remove);
                    $arrayCountChild = count($arrayKeyChild);
                    if ($arrayCountChild > 0) {
                        $this->output .= $this->createList($arrayMenu[$menuItem]);
                    }
                }
                $this->output .= $this->li('close');
            }
        }
        $this->output .= $this->ul('close');
    }
839482
def _format_sync_list(self, records):
        
        results = {}

        for attributes in records:
            if not isinstance(attributes, dict):
                id, attributes = attributes, {}
            else:
                id = list(attributes.keys())[0]
                attributes = attributes[id]

            results[id] = attributes

        return results