1<?php
2
3/**
4 * DokuWiki Plugin latexcaption (Helper functions)
5 *
6 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
7 * @author  Ben van Magill <ben.vanmagill16@gmail.com>
8 */
9
10/**
11 * Common functions
12 */
13class helper_plugin_latexcaption extends \dokuwiki\Extension\Plugin {
14
15    function number_to_alphabet($number) {
16        $number = intval($number);
17        if ($number <= 0) {
18            return '';
19        }
20        $alphabet = '';
21        while($number != 0) {
22            $p = ($number - 1) % 26;
23            $number = intval(($number - $p) / 26);
24            $alphabet = chr(65 + $p) . $alphabet;
25        }
26        return strtolower($alphabet);
27    }
28}
29
30